[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH 1/2] patch: fix debug log failure
From:       Aaro Koskinen <aaro.koskinen () iki ! fi>
Date:       2016-11-21 22:19:50
Message-ID: 20161121221951.999-1-aaro.koskinen () iki ! fi
[Download RAW message or body]

If we reach the end of plist it means the input has still data while we
are expecting EOF. Fix the log to avoid a crash.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
---
 editors/patch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/editors/patch.c b/editors/patch.c
index 988021d..4ee9339 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -295,7 +295,7 @@ static int apply_one_hunk(void)
 				// recheck remaining buffered data for a new match.
 
 				if (PATCH_DEBUG)
-					fdprintf(2, "NOT: %s\n", plist->data);
+					fdprintf(2, "NOT: %s\n", plist ? plist->data : "EOF");
 
 				TT.state = 3;
 				check = buf;
-- 
2.9.2

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic