[BusyBox 0004494]: segfault in bb_show_usage when using FEATURE_COMPRESS_USAGE on powerpc platform (probable endian unsafety)

bugs at busybox.net bugs at busybox.net
Sun Aug 10 14:29:48 UTC 2008


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=4494 
====================================================================== 
Reported By:                whitpa
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   4494
Category:                   Other
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             08-07-2008 06:00 PDT
Last Modified:              08-10-2008 07:29 PDT
====================================================================== 
Summary:                    segfault in bb_show_usage when using
FEATURE_COMPRESS_USAGE on powerpc platform (probable endian unsafety)
Description: 
On a PowerPC platform using compressed help, whenever any attempt is made
to print usage strings (whether volunteered by the applet or requested via
--help), archival/libunarchive/decompress_bunzip2.c:start_bunzip() returns
RETVAL_NOT_BZIP_DATA, such that libbb/appletlib.c:unpack_usage_messages()
returns a NULL pointer and libbb/appletlib.c:bb_show_usage() subsequently
dereferences it. 

====================================================================== 

---------------------------------------------------------------------- 
 vda - 08-09-08 11:26  
---------------------------------------------------------------------- 
applets/usage_compressed:

...

# Extra effort to avoid using "od -t x1": -t is not available
# in non-CONFIG_DESKTOPed busybox od

"$loc/usage" | bzip2 -1 | od -v -x \
| $SED -e 's/^[^ ]*//' \
| $SED -e 's/ //g' \
| grep -v '^$' \
| $SED -e 's/\(..\)\(..\)/0x\2,0x\1,/g'

...

Please try this: replace "od -v -x" with "od -v -t x1" and replace
last sed's s command with 's/\(..\)/0x\1,/g'

 

---------------------------------------------------------------------- 
 whitpa - 08-09-08 16:39  
---------------------------------------------------------------------- 
Thanks, the applets/usage_compressed fix resolves the issue - compressed
help text is now printing correctly. 

---------------------------------------------------------------------- 
 vda - 08-10-08 07:29  
---------------------------------------------------------------------- 
Fixed in svn. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
08-07-08 06:00  whitpa         New Issue                                    
08-07-08 06:00  whitpa         Status                   new => assigned     
08-07-08 06:00  whitpa         Assigned To               => BusyBox         
08-09-08 11:26  vda            Note Added: 0010364                          
08-09-08 11:26  vda            Note Edited: 0010364                         
08-09-08 16:39  whitpa         Note Added: 0010374                          
08-10-08 07:29  vda            Status                   assigned => closed  
08-10-08 07:29  vda            Note Added: 0010384                          
======================================================================




More information about the busybox-cvs mailing list