Harden message handling in the debugger agent.
This defect have been reported by the Coverity Prevent static analysis tool. Review URL: http://codereview.chromium.org/160327 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2580 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
98425a31f1
commit
e13c319f7c
@ -254,8 +254,8 @@ SmartPointer<char> DebuggerAgentUtil::ReceiveMessage(const Socket* conn) {
|
||||
|
||||
// Check that key is Content-Length.
|
||||
if (strcmp(key, kContentLength) == 0) {
|
||||
// Get the content length value if within a sensible range.
|
||||
if (strlen(value) > 7) {
|
||||
// Get the content length value if present and within a sensible range.
|
||||
if (value == NULL || strlen(value) > 7) {
|
||||
return SmartPointer<char>();
|
||||
}
|
||||
for (int i = 0; value[i] != '\0'; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user