Commit 4c16d95a authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Don't crash when passing null destinations to bind, connect, and sendto

Passing a null address to bind or connect is invalid (for
AF_INET6 socekts, they return EINVAL), so throw NPE. Passing a
null address to sendto is valid and means "send to the address
this socket is connected to". Pass the call to the kernel as
the app would expect.

There should be no backwards compatibility implications to this
change because previously these operations would just crash with
a JNI error. See previous CL in topic.

Bug: 126699941
Test: atest CtsLibcoreTestCases:libcore.libcore.io.OsTest#testCrossFamilyBindConnectSendto
Change-Id: I1d36c13e8d0ee426993f4bab33cfcfdc1603bfc8
parent 7fdf2272
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment