Commit e13c319f authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

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
parent 98425a31
......@@ -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++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment