[BusyBox 0001442]: [patch] with getopt32.c to support GETOPT_LONG options truly

bugs at busybox.net bugs at busybox.net
Wed Jul 25 17:18:30 UTC 2007


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=1442 
====================================================================== 
Reported By:                rockeychu
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1442
Category:                   Other
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             07-24-2007 23:05 PDT
Last Modified:              07-25-2007 10:18 PDT
====================================================================== 
Summary:                    [patch] with getopt32.c to support GETOPT_LONG
options truly
Description: 
Sine SVN version 19236, getopt32 is not truly GETOPT_LONG options.
Test with 'ls --color' or other cmd with GETOPT_LONG enabled.

Patch as following:

Index: libbb/getopt32.c
===================================================================
--- libbb/getopt32.c    (revision 19256)
+++ libbb/getopt32.c    (working copy)
@@ -354,7 +354,9 @@
			count++;
		}
		/* count == no. of longopts + 1 */
-		long_options = alloca(count * sizeof(*long_options));
+		size_t size = count * sizeof(*long_options);
+		long_options = alloca(size);
+		memset(long_options, 0, size);
		i = 0;
		optstr = applet_long_options;
		while (--count) {

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

---------------------------------------------------------------------- 
 vda - 07-25-07 10:18  
---------------------------------------------------------------------- 
fixed, thanks! 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-24-07 23:05  rockeychu      New Issue                                    
07-24-07 23:05  rockeychu      Status                   new => assigned     
07-24-07 23:05  rockeychu      Assigned To               => BusyBox         
07-25-07 10:18  vda            Status                   assigned => closed  
07-25-07 10:18  vda            Note Added: 0002639                          
======================================================================




More information about the busybox-cvs mailing list