]> granicus.if.org Git - file/commitdiff
Reset to the end of the buffer if not enough lines were found. Found by
authorChristos Zoulas <christos@zoulas.com>
Tue, 5 Sep 2017 20:41:59 +0000 (20:41 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 5 Sep 2017 20:41:59 +0000 (20:41 +0000)
clusterfuzz.

src/softmagic.c

index b9e975374b4038568ee431324aedd24c453362b8..94d5b8277efa9c128fbc582c20507b535c447902 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.249 2017/06/19 18:30:25 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.250 2017/09/05 20:41:59 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -1232,7 +1232,7 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
                                        b++;
                        }
                        if (lines)
-                               last = RCAST(const char *, s) + bytecnt;
+                               last = end;
 
                        ms->search.s = buf;
                        ms->search.s_len = last - buf;