From: Jim Meyering Date: Thu, 20 Oct 2005 14:20:34 +0000 (+0000) Subject: (mode_compile): Reject an invalid mode string that X-Git-Tag: v5.92~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4667affc0129753b5f852d1ec2f02b5dee8040f;p=thirdparty%2Fcoreutils.git (mode_compile): Reject an invalid mode string that starts with an octal digit. From Andreas Gruenbacher. --- diff --git a/lib/modechange.c b/lib/modechange.c index 6ab9cb6fdd..52c5debca3 100644 --- a/lib/modechange.c +++ b/lib/modechange.c @@ -124,6 +124,9 @@ mode_compile (char const *mode_string) } while ('0' <= *mode_string && *mode_string < '8'); + if (*mode_string) + return NULL; + /* Help the compiler optimize the usual case where mode_t uses the traditional octal representation. */ mode = ((S_ISUID == SUID && S_ISGID == SGID && S_ISVTX == SVTX