Index: chrome/browser/extensions/api/socket/socket_api.cc |
=================================================================== |
--- chrome/browser/extensions/api/socket/socket_api.cc (revision 138049) |
+++ chrome/browser/extensions/api/socket/socket_api.cc (working copy) |
@@ -173,7 +173,9 @@ |
base::BinaryValue::CreateWithCopiedBuffer(io_buffer->data(), |
bytes_read)); |
} else { |
- result->Set(kDataKey, new base::BinaryValue()); |
+ // BinaryValue does not support NULL buffer. Workaround it with new char[1]. |
+ // http://crbug.com/127630 |
+ result->Set(kDataKey, base::BinaryValue::Create(new char[1], 0)); |
} |
result_.reset(result); |
@@ -254,7 +256,9 @@ |
base::BinaryValue::CreateWithCopiedBuffer(io_buffer->data(), |
bytes_read)); |
} else { |
- result->Set(kDataKey, new base::BinaryValue()); |
+ // BinaryValue does not support NULL buffer. Workaround it with new char[1]. |
+ // http://crbug.com/127630 |
+ result->Set(kDataKey, base::BinaryValue::Create(new char[1], 0)); |
} |
result->SetString(kAddressKey, address); |
result->SetInteger(kPortKey, port); |