diff options
author | Rich Felker <dalias@aerifal.cx> | 2023-11-16 12:55:21 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2023-11-16 12:55:21 -0500 |
commit | f314e133929b6379eccc632bef32eaebb66a7335 (patch) | |
tree | 9121f0013f69c40d50c0dfa41b8959ed5f6e7dc0 /src | |
parent | ee1d39bc1573c1ae49ee6b658938b56bbef95a6c (diff) | |
download | musl-f314e133929b6379eccc632bef32eaebb66a7335.tar.gz musl-f314e133929b6379eccc632bef32eaebb66a7335.tar.xz musl-f314e133929b6379eccc632bef32eaebb66a7335.zip |
mntent: fields are delimited only by tabs or spaces, not general whitespace
this matters because the kernel-provided mtab only escapes tabs, spaces, newlines, and backslashes. it leaves carriage returns, form feeds, and vertical tabs literal.
Diffstat (limited to 'src')
-rw-r--r-- | src/misc/mntent.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/misc/mntent.c b/src/misc/mntent.c index e9393883..78bf0cd0 100644 --- a/src/misc/mntent.c +++ b/src/misc/mntent.c @@ -81,7 +81,7 @@ struct mntent *getmntent_r(FILE *f, struct mntent *mnt, char *linebuf, int bufle len = strlen(linebuf); if (len > INT_MAX) continue; for (i = 0; i < sizeof n / sizeof *n; i++) n[i] = len; - sscanf(linebuf, " %n%*s%n %n%*s%n %n%*s%n %n%*s%n %d %d", + sscanf(linebuf, " %n%*[^ \t]%n %n%*[^ \t]%n %n%*[^ \t]%n %n%*[^ \t]%n %d %d", n, n+1, n+2, n+3, n+4, n+5, n+6, n+7, &mnt->mnt_freq, &mnt->mnt_passno); } while (linebuf[n[0]] == '#' || n[1]==len); |