bugGNUstep - Bugs: bug #24683, -[NSString intValue] fails if...

Group
 
 

bug #24683: -[NSString intValue] fails if string contains >31 leading whitespace characters

Submitter:  Larry Campbell <lcampbel>
Submitted:  Tue 28 Oct 2008 06:07:36 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 28 Oct 2008 06:39:46 PM UTC, comment #1: 

Fixed in svn thanks.

Richard Frith-Macdonald <CaS>
Group Member
Tue 28 Oct 2008 06:07:36 PM UTC, original submission:  

Due to this lossage in GSString.m (intValue_c, and similarly for intValue_u):

      unsigned  len = self->_count < 32 ? self->_count : 31;
      char      buf[len+1];

      memcpy(buf, self->_contents.c, len);
      buf[len] = '\0';
      return atol((const char*)buf);

If the string contains more than 31 leading whitespace characters, zero is returned instead of the correct value.


Larry Campbell <lcampbel>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by lcampbel (Submitted the item)
  • -email is unavailable- added by lcampbel
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-10-28 CaS StatusNone Fixed
        Open/ClosedOpen Closed
    2008-10-28 lcampbel Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code