File file-9fbe768a87.patch of Package file.16612

From 9fbe768a87d3c4d46058e9cd2e190320815d931a Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Tue, 5 Sep 2017 20:41:59 +0000
Subject: [PATCH] Reset to the end of the buffer if not enough lines were
 found. Found by clusterfuzz.

---
 src/softmagic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- src/softmagic.c
+++ src/softmagic.c	2017-10-23 13:16:21.553263634 +0000
@@ -1137,7 +1137,7 @@ mcopy(struct magic_set *ms, union VALUET
 					b++;
 			}
 			if (lines)
-				last = RCAST(const char *, s) + bytecnt;
+				last = end;
 
 			ms->search.s = buf;
 			ms->search.s_len = last - buf;
openSUSE Build Service is sponsored by