diff options
author | Christos Zoulas <christos@zoulas.com> | 2015-09-10 14:39:55 +0000 |
---|---|---|
committer | Christos Zoulas <christos@zoulas.com> | 2015-09-10 14:39:55 +0000 |
commit | 9edf13cae19e9de85a240e6e811406df6b414259 (patch) | |
tree | 4b146c3d4fb651cc33dc17a52a9e75af9b5d5709 /src/apprentice.c | |
parent | d378b98ca612f01d8c3a2389640c4e636860d149 (diff) | |
download | file-git-9edf13cae19e9de85a240e6e811406df6b414259.tar.gz |
PR/475: Fix past end of buffer read.
Diffstat (limited to 'src/apprentice.c')
-rw-r--r-- | src/apprentice.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/apprentice.c b/src/apprentice.c index 52cd83c5..3eb1be03 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -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)); |