[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox-cvs
Subject:    [BusyBox 0001442]: [patch] with getopt32.c to support GETOPT_LONG options truly
From:       bugs () busybox ! net (bugs at busybox ! net)
Date:       2007-07-25 6:05:35
Message-ID: 1b01b5cac4b08d7ebc5a0702313bfbc0 () bugs ! busybox ! net
[Download RAW message or body]


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic