Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(80)

Issue 491002: Not checking properly the return value of SuspendThread on Windows (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 6 months ago by Ivan Penkov
Modified:
11 years, 5 months ago
Reviewers:
ted mielczarek; siyangxie, siyangxie
Base URL:
http://google-breakpad.googlecode.com/svn/trunk/src/
Visibility:
Public.

Description

SuspendThread returns a DWORD value, so checking the return value with ">= 0"
doesn't work.  On failure, the return value is (DWORD) -1 (which is
0xFFFFFFFF).

  DWORD last_suspend_count = -1;
  ...
  last_suspend_count = SuspendThread(child_thread_handle);
  if (last_suspend_count >= 0) {
    ...
  }

Patch Set 1 #

Patch Set 2 : Using C++ cast instead of C-style #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M client/windows/handler/exception_handler.cc View 1 4 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 3
ivanpe.google
SuspendThread returns a DWORD value, so checking the return value with ">= 0" doesn't work. ...
11 years, 6 months ago #1
Ivan Penkov
.
11 years, 6 months ago #2
SiyangXie
11 years, 5 months ago #3
LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted