]> granicus.if.org Git - file/commitdiff
PR/475: Fix past end of buffer read.
authorChristos Zoulas <christos@zoulas.com>
Thu, 10 Sep 2015 14:39:55 +0000 (14:39 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 10 Sep 2015 14:39:55 +0000 (14:39 +0000)
src/apprentice.c

index 52cd83c5b6d34810e373f13a5df74f029b098d49..3eb1be03367ad6f4302c0eaa175f9432f8db4204 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.235 2015/09/10 13:59:47 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.236 2015/09/10 14:39:55 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -2742,6 +2742,7 @@ getstr(struct magic_set *ms, struct magic *m, const char *s, int warn)
                } else
                        *p++ = (char)c;
        }
+       --s;
 out:
        *p = '\0';
        m->vallen = CAST(unsigned char, (p - origp));