Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1878)

Unified Diff: ipc/ipc_message.cc

Issue 717793005: Fix signed integer overflow in GetRefNumUpper24. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message.cc
diff --git a/ipc/ipc_message.cc b/ipc/ipc_message.cc
index 7bd7a697c4fdc9d1c8cc649204de3228b76608d3..82b136ac2055a5f7b2f588ce617934dbf3e33ab1 100644
--- a/ipc/ipc_message.cc
+++ b/ipc/ipc_message.cc
@@ -22,8 +22,8 @@ base::StaticAtomicSequenceNumber g_ref_num;
// 8 bits set to 0 for use as flags.
inline uint32 GetRefNumUpper24() {
base::debug::TraceLog* trace_log = base::debug::TraceLog::GetInstance();
- int32 pid = trace_log ? trace_log->process_id() : 0;
- int32 count = g_ref_num.GetNext();
+ uint32 pid = trace_log ? trace_log->process_id() : 0;
+ uint32 count = g_ref_num.GetNext();
// The 24 bit hash is composed of 14 bits of the count and 10 bits of the
// Process ID. With the current trace event buffer cap, the 14-bit count did
// not appear to wrap during a trace. Note that it is not a big deal if
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698