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

Unified Diff: extensions/browser/api/cast_channel/cast_auth_util.cc

Issue 890683002: Fix buffer overflow due to unbounded strlen over a non-null terminated string. Detected by asan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback. Created 5 years, 11 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: extensions/browser/api/cast_channel/cast_auth_util.cc
diff --git a/extensions/browser/api/cast_channel/cast_auth_util.cc b/extensions/browser/api/cast_channel/cast_auth_util.cc
index e2beca1870179241a76f4a2aab586859b8fca55b..3377a2fb129ba5cf2bc1b5b6910a75e026a88137 100644
--- a/extensions/browser/api/cast_channel/cast_auth_util.cc
+++ b/extensions/browser/api/cast_channel/cast_auth_util.cc
@@ -137,8 +137,11 @@ AuthResult AuthenticateChallengeReply(const CastMessage& challenge_reply,
return result;
}
- if (response.client_auth_certificate().find(reinterpret_cast<const char*>(
- kAudioOnlyPolicy)) != std::string::npos) {
+ std::string audio_policy =
mark a. foltz 2015/01/30 00:22:42 const std::string&
Kevin M 2015/01/30 22:15:47 I didn't know this was legal. Cool.
+ std::string(reinterpret_cast<const char*>(kAudioOnlyPolicy),
+ (arraysize(kAudioOnlyPolicy) / sizeof(unsigned char)));
+ if (response.client_auth_certificate().find(audio_policy) !=
+ std::string::npos) {
result.channel_policies |= AuthResult::POLICY_AUDIO_ONLY;
}
« 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