OSDN Git Service

Switch LocalSocket to android::base::{Send,Receive}FileDescriptorVector.
authorJosh Gao <jmgao@google.com>
Mon, 11 Feb 2019 22:37:21 +0000 (14:37 -0800)
committerJosh Gao <jmgao@google.com>
Tue, 26 Feb 2019 07:21:23 +0000 (23:21 -0800)
commit79e3be8a84cf70a87f48c4299fc7051d3d618c5f
tree249519c6441e21728f74b0e232a3acc2b050ad57
parente24b30b7d4b8851592c59446939fe032aef439a0
Switch LocalSocket to android::base::{Send,Receive}FileDescriptorVector.

The previous implementation allocated an array of size
CMSG_SPACE(count) to store CMSG_LEN(count * sizeof(int)) elements, which
leads to bad things happening for values of count greater than 1 on
32-bit, and 2 on 64-bit.

Test: atest android.net.LocalSocketTest
Test: atest android.net.cts.LocalSocketTest
Change-Id: I0a9502c3358d8fa92d2d20e344c6270d6baedc07
core/jni/android_net_LocalSocketImpl.cpp