[backfire] busybox: backport r29156
[openwrt-10.03/.git] / package / busybox / patches / 700-hexdump_segfault_fix.patch
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..9bb9ad8
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/libbb/dump.c
++++ b/libbb/dump.c
+@@ -304,7 +304,7 @@ static void rewrite(priv_dumper_t *dumpe
+               ) {
+                       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;