bornintelligent / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

HTTPUpload::GetFileContents() crashes on 0-length files #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This snippet will crash if the file is 0 bytes:

    int length = file.tellg();
    contents->resize(length);
    file.seekg(0, ios::beg);
    file.read(&((*contents)[0]), length);

Original issue reported on code.google.com by bry...@gmail.com on 23 Nov 2006 at 3:06

GoogleCodeExporter commented 9 years ago
This patch fixes the immediate problem.  I think there may be some other unsafe 
usage
of vector [0] in the processor code, but I don't have time to track them down 
at the
moment.

Original comment by bry...@gmail.com on 25 Nov 2006 at 12:11

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by bry...@gmail.com on 27 Nov 2006 at 6:38