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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitted by:  Larry Campbell <lcampbel>
Submitted on:  Tue 28 Oct 2008 06:07:36 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

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

Fixed in svn thanks.

Richard Frith-Macdonald <CaS>
Project 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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 28 Oct 2008 06:39:46 PM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 28 Oct 2008 06:07:36 PM UTClcampbelCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1