From ea7c18514b6c9304b969cd977390aa09f5095f8d Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 28 Jun 2006 13:50:59 +0000 Subject: Fix http://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 "". --- editors/sed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors') 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; -- cgit v1.2.3