bugfastcgi++ - Bugs: bug #36517, dereferencing iterator behind end...

 
 
Show feedback again

bug #36517: dereferencing iterator behind end of buffer

Submitted by:  David Schneider <davidschneider>
Submitted on:  Mon 21 May 2012 04:04:27 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Eddie Carle <eddic>
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 12 Jun 2012 10:20:02 AM UTC, comment #2:

The changes seems to fix the bug. valgrind is quiet now.

David Schneider <davidschneider>
Sun 27 May 2012 01:51:55 AM UTC, comment #1:

I've committed something that I think should fix it. Try it out and see if the compilers complain.

Eddie Carle <eddic>
Project AdministratorIn charge of this item.
Mon 21 May 2012 04:04:27 PM UTC, original submission:

http.cpp:488: The algorithm used to decode url encoded parameters searches also behind the last character in the buffer. Perhaps nothing will happen as long as nameStart and valueStart are the termination criteria. But valgrind doesn't like it.
My solution was to let the algorithm how it was. Just resize and initialize the buffer.

request.cpp:116: comparing const char* with a shorter string will dereference the std::string::iterator behind end of string. MVC has some checks for that in debug mode.
I don't like MACROs, but it could be ok in cpp file.

David Schneider <davidschneider>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #25899:  http.cpp.patch added by davidschneider (372B - text/x-patch)
file #25900:  request.cpp.patch added by davidschneider (982B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 13 Jun 2012 02:11:45 AM UTCeddicStatusReady For Test=>Fixed
    Sun 27 May 2012 01:51:55 AM UTCeddicStatusNone=>Ready For Test
      Assigned toNone=>eddic
    Mon 21 May 2012 04:04:27 PM UTCdavidschneiderAttached File-=>Added http.cpp.patch, #25899
      Attached File-=>Added request.cpp.patch, #25900
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup