mirror of
https://github.com/sheumann/hush.git
synced 2024-12-28 22:30:05 +00:00
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 "".
This commit is contained in:
parent
cc826d74e4
commit
ea7c18514b
@ -1054,7 +1054,7 @@ restart:
|
|||||||
case 'x': /* Exchange hold and pattern space */
|
case 'x': /* Exchange hold and pattern space */
|
||||||
{
|
{
|
||||||
char *tmp = pattern_space;
|
char *tmp = pattern_space;
|
||||||
pattern_space = bbg.hold_space;
|
pattern_space = bbg.hold_space ? : xzalloc(1);
|
||||||
no_newline=0;
|
no_newline=0;
|
||||||
bbg.hold_space = tmp;
|
bbg.hold_space = tmp;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user