From 9edf13cae19e9de85a240e6e811406df6b414259 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Thu, 10 Sep 2015 14:39:55 +0000 Subject: [PATCH] PR/475: Fix past end of buffer read. --- src/apprentice.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)); -- 2.40.0