]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Don't skip past zero byte in profile parsing
authorGreg Hudson <ghudson@mit.edu>
Wed, 14 Aug 2019 15:46:14 +0000 (11:46 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 9 Dec 2019 22:02:52 +0000 (17:02 -0500)
In parse_quoted_string(), only process an escape sequence if there is
a second character after the backlash, to avoid reading past the
terminating zero byte.  Reported by Lutz Justen.

(cherry picked from commit a449bfc16c32019fec8b4deea963a3e474b0d14d)

ticket: 8825
version_fixed: 1.17.1

src/util/profile/prof_parse.c

index 531e4a099065e4228cb05612fc08bf096e788218..7ba44aca6eeeb71f445c261800ba178921750800 100644 (file)
@@ -48,7 +48,7 @@ static void parse_quoted_string(char *str)
     char *to, *from;
 
     for (to = from = str; *from && *from != '"'; to++, from++) {
-        if (*from == '\\') {
+        if (*from == '\\' && *(from + 1) != '\0') {
             from++;
             switch (*from) {
             case 'n':