busybox: fix hexdump segmentation fault with an empty leading format unit

SVN-Revision: 29156
This commit is contained in:
Jo-Philipp Wich
2011-11-15 17:38:55 +00:00
parent 817c72ef02
commit d0f5b51a8b
2 changed files with 14 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -301,7 +301,7 @@ static NOINLINE void rewrite(priv_dumper
) {
fu->reps += (dumper->blocksize - fs->bcnt) / fu->bcnt;
}
- if (fu->reps > 1) {
+ if (fu->reps > 1 && fu->nextpr) {
for (pr = fu->nextpr;; pr = pr->nextpr)
if (!pr->nextpr)
break;