[BusyBox 0000428]: Extra space character (0x20) is added to last string option

bugs at busybox.net bugs at busybox.net
Sun Dec 18 19:56:55 UTC 2005


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=428 
====================================================================== 
Reported By:                mareksk
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   428
Category:                   Kernel Module Support
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             09-13-2005 10:55 PDT
Last Modified:              12-18-2005 11:56 PST
====================================================================== 
Summary:                    Extra space character (0x20) is added to last string
option
Description: 
Extra space character (0x20) is always being added to the last option
passed to insmod. In case of the last option is a string value, this value
is expanded by one character. For instance, if the last option is arg=1234,
the string passed to a module is "1234 ".

The code below points a part of 'mod_insert' function, where a simple fix
could be added

for ( i = 0; i < argc; i++ ) {
  strcat ( head-> m_options, argv [i] );
  /* this prevents from adding an extra 0x20 after the last option */
  if( (i+1) < argc ) {  
    strcat ( head-> m_options, " " );
  }
}

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

---------------------------------------------------------------------- 
 integrator - 11-23-05 14:22  
---------------------------------------------------------------------- 
It broke in rev. 11043. Before, the shell would have parsed the options,
and removed the trailing space. It's no longer the case, because we don't
use a shell.
As a first quick fix, enable multiple options parsing. 

---------------------------------------------------------------------- 
 landley - 12-18-05 11:56  
---------------------------------------------------------------------- 
svn 12922 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-13-05 10:55  mareksk        New Issue                                    
09-13-05 10:55  mareksk        Status                   new => assigned     
09-13-05 10:55  mareksk        Assigned To               => BusyBox         
11-23-05 14:22  integrator     Note Added: 0000691                          
12-18-05 11:56  landley        Status                   assigned => closed  
12-18-05 11:56  landley        Note Added: 0000797                          
======================================================================




More information about the busybox-cvs mailing list