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

bugs at busybox.net bugs at busybox.net
Wed Jul 25 06:05:35 UTC 2007


The following issue has been SUBMITTED. 
====================================================================== 
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:                     assigned
====================================================================== 
Date Submitted:             07-24-2007 23:05 PDT
Last Modified:              07-24-2007 23:05 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) {

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

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         
======================================================================




More information about the busybox-cvs mailing list