diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-08-23 23:15:48 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-08-23 23:15:48 +0000 |
commit | 15f2fdb2b9ba0d397babe0922ae28f84e91505f9 (patch) | |
tree | 7d4c22cda9908393ead53c79b11f779dc96977f2 | |
parent | 7fe21c69cdfbe3863aa69f40df6bbbe7abe4af8d (diff) | |
download | busybox-w32-15f2fdb2b9ba0d397babe0922ae28f84e91505f9.tar.gz busybox-w32-15f2fdb2b9ba0d397babe0922ae28f84e91505f9.tar.bz2 busybox-w32-15f2fdb2b9ba0d397babe0922ae28f84e91505f9.zip |
hexdump: fix SEGV in hexdump -e ""
-rw-r--r-- | libbb/dump.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libbb/dump.c b/libbb/dump.c index 74c5e1691..e7722de5a 100644 --- a/libbb/dump.c +++ b/libbb/dump.c | |||
@@ -298,7 +298,7 @@ static void rewrite(priv_dumper_t *dumper, FS *fs) | |||
298 | * if, rep count is greater than 1, no trailing whitespace | 298 | * if, rep count is greater than 1, no trailing whitespace |
299 | * gets output from the last iteration of the format unit. | 299 | * gets output from the last iteration of the format unit. |
300 | */ | 300 | */ |
301 | for (fu = fs->nextfu;; fu = fu->nextfu) { | 301 | for (fu = fs->nextfu; fu; fu = fu->nextfu) { |
302 | if (!fu->nextfu && fs->bcnt < dumper->blocksize | 302 | if (!fu->nextfu && fs->bcnt < dumper->blocksize |
303 | && !(fu->flags & F_SETREP) && fu->bcnt | 303 | && !(fu->flags & F_SETREP) && fu->bcnt |
304 | ) { | 304 | ) { |
@@ -723,7 +723,8 @@ void FAST_FUNC bb_dump_add(dumper_t* pub_dumper, const char *fmt) | |||
723 | nextfupp = &tfs->nextfu; | 723 | nextfupp = &tfs->nextfu; |
724 | 724 | ||
725 | /* take the format string and break it up into format units */ | 725 | /* take the format string and break it up into format units */ |
726 | for (p = fmt;;) { | 726 | p = fmt; |
727 | for (;;) { | ||
727 | p = skip_whitespace(p); | 728 | p = skip_whitespace(p); |
728 | if (!*p) { | 729 | if (!*p) { |
729 | break; | 730 | break; |