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

Unified Diff: net/spdy/spdy_framer.cc

Issue 1123153003: Reject empty protocol id in HTTP/2 ALTSVC frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index ea5eaa564b3b9b92667fd03bac10d1f59ce1a943..49a73a581eb54b9ba929e5c5fa76aaa990e6df29 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -2056,8 +2056,9 @@ size_t SpdyFramer::ProcessAltSvcFramePayload(const char* data, size_t len) {
reader.ReadUInt8(&altsvc_scratch_.pid_len);
DCHECK(successful_read);
// Sanity check length value.
- if (GetAltSvcMinimumSize() + altsvc_scratch_.pid_len >=
- current_frame_length_) {
+ if (altsvc_scratch_.pid_len == 0 ||
+ GetAltSvcMinimumSize() + altsvc_scratch_.pid_len >=
+ current_frame_length_) {
set_error(SPDY_INVALID_CONTROL_FRAME);
return 0;
}
« no previous file with comments | « no previous file | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698