From: Rob Landley Date: Wed, 28 Jun 2006 13:50:59 +0000 (-0000) Subject: Fix http://bugs.busybox.net/view.php?id=826 in which "(echo; echo) | sed x" X-Git-Tag: 1_2_0~70 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ea7c18514b6c9304b969cd977390aa09f5095f8d;p=oweals%2Fbusybox.git Fix bugs.busybox.net/view.php?id=826 in which "(echo; echo) | sed x" crashes because the empty state of the hold space is NULL but the empty state of the pattern space is "". --- diff --git a/editors/sed.c b/editors/sed.c index 219a44008..ed584e5df 100644 --- a/editors/sed.c +++ b/editors/sed.c @@ -1054,7 +1054,7 @@ restart: case 'x': /* Exchange hold and pattern space */ { char *tmp = pattern_space; - pattern_space = bbg.hold_space; + pattern_space = bbg.hold_space ? : xzalloc(1); no_newline=0; bbg.hold_space = tmp; break;