beezar / google-breakpad

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

Unsafe cast in http_upload.cc in line 339 #502

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile on visual c++ with \W3 and \WX switches
2. The build breaks

What is the expected output? What do you see instead?
compile should succeed but does not

Please use labels and text to provide additional information.

In 
http://code.google.com/p/google-breakpad/source/browse/trunk/src/common/windows/
http_upload.cc

At line 339, 
contents->resize(length);
length is a signed int but resize expects an unsigned int. We should cast 
explicitly or change length to be unsigned.

Original issue reported on code.google.com by siddha...@google.com on 26 Oct 2012 at 9:56

GoogleCodeExporter commented 9 years ago
Fixed in r1189.

Original comment by thestig@chromium.org on 18 Dec 2013 at 12:08