diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-28 13:50:59 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-28 13:50:59 +0000 |
commit | 7f4d3a837ab5c35497224aa800e6c18b3eafa062 (patch) | |
tree | a3c7e4db3d16f5c86e515c4d4c95cd0038d7a121 /editors/sed.c | |
parent | 022a211a7093b950aab2a39c064c11cddf7232d0 (diff) | |
download | busybox-w32-7f4d3a837ab5c35497224aa800e6c18b3eafa062.tar.gz busybox-w32-7f4d3a837ab5c35497224aa800e6c18b3eafa062.tar.bz2 busybox-w32-7f4d3a837ab5c35497224aa800e6c18b3eafa062.zip |
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 "".
git-svn-id: svn://busybox.net/trunk/busybox@15539 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'editors/sed.c')
-rw-r--r-- | editors/sed.c | 2 |
1 files changed, 1 insertions, 1 deletions
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: | |||
1054 | case 'x': /* Exchange hold and pattern space */ | 1054 | case 'x': /* Exchange hold and pattern space */ |
1055 | { | 1055 | { |
1056 | char *tmp = pattern_space; | 1056 | char *tmp = pattern_space; |
1057 | pattern_space = bbg.hold_space; | 1057 | pattern_space = bbg.hold_space ? : xzalloc(1); |
1058 | no_newline=0; | 1058 | no_newline=0; |
1059 | bbg.hold_space = tmp; | 1059 | bbg.hold_space = tmp; |
1060 | break; | 1060 | break; |