[BusyBox 0000826]: sed crashes when 'x' command run on an empty hold space

bugs at busybox.net bugs at busybox.net
Tue Apr 11 08:38:14 UTC 2006


The following issue has been SUBMITTED. 
====================================================================== 
http://busybox.net/bugs/view.php?id=826 
====================================================================== 
Reported By:                lionel
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   826
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             04-11-2006 01:38 PDT
Last Modified:              04-11-2006 01:38 PDT
====================================================================== 
Summary:                    sed crashes when 'x' command run on an empty hold
space
Description: 
When executing the x command while the current hold space is empty, sed
crashes.
To reproduce, just type the following command line:

[root at localhost busybox-1.1.1_new]# (echo;echo) | ./busybox sed -e x
Segmentation fault

On GNU sed:
bash-3.00$ (echo;echo) | sed -e x


This is due to a NULL pointer being exchanged between hold and pattern
space and can be sorted out by allocating an empty string in the pattern
space when x is issued and the hold space is empty.

I attach a short patch for this to work (this patch works for
busybox-1.1.0 and busybox-1.1.1)
====================================================================== 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-11-06 01:38  lionel         New Issue                                    
04-11-06 01:38  lionel         Status                   new => assigned     
04-11-06 01:38  lionel         Assigned To               => BusyBox         
04-11-06 01:38  lionel         File Added: sed_x_command_on_empty_hold.patch    
               
======================================================================




More information about the busybox-cvs mailing list