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

Unified Diff: base/posix/unix_domain_socket.cc

Issue 11108019: linux: Crash browser on too-big messages to zygote. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update CHECKs Created 8 years, 2 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 | « base/posix/unix_domain_socket.h ('k') | content/browser/zygote_host/zygote_host_impl_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/posix/unix_domain_socket.cc
diff --git a/base/posix/unix_domain_socket.cc b/base/posix/unix_domain_socket.cc
index 36f4c431f665dd7624732f24e1865581b705029d..534f5f00fb2ed29dd434e83f6a4519520a43f873 100644
--- a/base/posix/unix_domain_socket.cc
+++ b/base/posix/unix_domain_socket.cc
@@ -14,6 +14,8 @@
#include "base/pickle.h"
#include "base/stl_util.h"
+const size_t UnixDomainSocket::kMaxFileDescriptors = 16;
+
// static
bool UnixDomainSocket::SendMsg(int fd,
const void* buf,
@@ -52,8 +54,6 @@ ssize_t UnixDomainSocket::RecvMsg(int fd,
void* buf,
size_t length,
std::vector<int>* fds) {
- static const unsigned kMaxDescriptors = 16;
-
fds->clear();
struct msghdr msg;
@@ -62,7 +62,7 @@ ssize_t UnixDomainSocket::RecvMsg(int fd,
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
- char control_buffer[CMSG_SPACE(sizeof(int) * kMaxDescriptors)];
+ char control_buffer[CMSG_SPACE(sizeof(int) * kMaxFileDescriptors)];
msg.msg_control = control_buffer;
msg.msg_controllen = sizeof(control_buffer);
« no previous file with comments | « base/posix/unix_domain_socket.h ('k') | content/browser/zygote_host/zygote_host_impl_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698