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

Unified Diff: webrtc/p2p/base/stun.cc

Issue 2071873002: Fix buffer overflow in HMAC validation of STUN messages. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months 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: webrtc/p2p/base/stun.cc
diff --git a/webrtc/p2p/base/stun.cc b/webrtc/p2p/base/stun.cc
index 180597ee77c11a46e52d379cf1c2fe5d7450291f..9878921a6072f018f1117becf5e7334078e01aca 100644
--- a/webrtc/p2p/base/stun.cc
+++ b/webrtc/p2p/base/stun.cc
@@ -154,7 +154,7 @@ bool StunMessage::ValidateMessageIntegrity(const char* data, size_t size,
// If M-I, sanity check it, and break out.
if (attr_type == STUN_ATTR_MESSAGE_INTEGRITY) {
if (attr_length != kStunMessageIntegritySize ||
- current_pos + attr_length > size) {
+ current_pos + attr_length >= size) {
Sergey Ulanov 2016/06/17 00:52:49 Should this be "current_pos + sizeof(attr_type) +
katrielc1 2016/06/17 08:21:55 Yes, you're right. (I think it may be equivalent
return false;
}
has_message_integrity_attr = true;
« 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