busybox: fix hexdump segmentation fault with an empty leading format unit
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 15 Nov 2011 17:38:55 +0000 (17:38 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 15 Nov 2011 17:38:55 +0000 (17:38 +0000)
SVN-Revision: 29156

package/busybox/Makefile
package/busybox/patches/700-hexdump_segfault_fix.patch [new file with mode: 0644]

index 967fa75dd147e499afe8ca16c5644fd11a7c7f1a..79893454668615878fd019814852cc5d5a35c858 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.19.3
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
@@ -72,6 +72,8 @@ ifdef CONFIG_BUSYBOX_USE_LIBRPC
   LDLIBS += rpc
 endif
 
+TARGET_CFLAGS += -ggdb3
+
 define Build/Compile
        $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
                CC="$(TARGET_CC)" \
diff --git a/package/busybox/patches/700-hexdump_segfault_fix.patch b/package/busybox/patches/700-hexdump_segfault_fix.patch
new file mode 100644 (file)
index 0000000..ab09fb3
--- /dev/null
@@ -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;