Code review: Check allocation and array sizes in minidump.cc (#12)

2 views
Skip to first unread message

Mark Mentovai

unread,
May 22, 2007, 10:56:33 AM5/22/07
to Brian Ryner, google-br...@googlegroups.com
Brian-

I've got a patch to replace a bunch of the TODOs in minidump.cc with
real checks for memory allocation sizes.

http://code.google.com/p/google-breakpad/issues/detail?id=12
http://code.google.com/p/google-breakpad/issues/attachment?aid=1502202035370182219&name=breakpad.12.1.patch

Mark

Brian Ryner

unread,
May 31, 2007, 1:12:59 AM5/31/07
to Mark Mentovai, google-br...@googlegroups.com
+    if (max_bytes_ != static_cast<u_int32_t>(-1) &&

Would it be better to use numeric_limits<u_intt32_t>::max() for these checks to be consistent with what you do elsewhere?  Then I don't think you'd need the special case since the value could never be greater than max().

Looks good otherwise.
--
-Brian
Reply all
Reply to author
Forward
0 new messages