21 lines
630 B
Diff
21 lines
630 B
Diff
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 2021-09-07 11:47:35.241613655 +0000
|
|
@@ -1234,7 +1234,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;
|