diff options
author | Joe Simmons-Talbott <josimmon@redhat.com> | 2023-07-05 21:23:28 +0000 |
---|---|---|
committer | Joe Simmons-Talbott <josimmon@redhat.com> | 2023-07-05 21:24:06 +0000 |
commit | 5324d258427fd11ca0f4f595c94016e568b26d6b (patch) | |
tree | ccdb786892d04ac4eab6dbd32bb649d5309ee606 /libio/fileops.c | |
parent | 02261d1bd930b50e9166086462dca885e9847826 (diff) | |
download | glibc-5324d258427fd11ca0f4f595c94016e568b26d6b.zip glibc-5324d258427fd11ca0f4f595c94016e568b26d6b.tar.gz glibc-5324d258427fd11ca0f4f595c94016e568b26d6b.tar.bz2 |
fileops: Don't process ,ccs= as individual mode flags (BZ#18906)
In processing the first 7 individual characters of the mode for fopen
if ,ccs= is used those characters will be processed as well. Stop
processing individual mode flags once a comma is encountered. This has
the effect of requiring ,ccs= to be the last mode flag in the mode
string. Add a testcase to check that the ,ccs= mode flag is not
processed as individual mode flags.
Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'libio/fileops.c')
-rw-r--r-- | libio/fileops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libio/fileops.c b/libio/fileops.c index 58c9e98..1c1113e 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -247,6 +247,7 @@ _IO_new_file_fopen (FILE *fp, const char *filename, const char *mode, switch (*++mode) { case '\0': + case ',': break; case '+': omode = O_RDWR; |