OSDN Git Service

Fix a buffer overrun in OSNetworkSystem.
authorElliott Hughes <enh@google.com>
Thu, 12 Nov 2009 05:55:42 +0000 (21:55 -0800)
committerElliott Hughes <enh@google.com>
Thu, 12 Nov 2009 19:27:37 +0000 (11:27 -0800)
commitf46138362aba4a424059b8bc8cc2d2fcc6d3ee66
treea83166fc018ff5c05083a2a50add9f4db0e4bf3c
parentde1aa11481e683c247f5609ce409ae674ee1c1b5
Fix a buffer overrun in OSNetworkSystem.

Given an IPv6 address in a non-standard (Java-specific) form, we used to
overrun an on-stack buffer that was assuming the standard (shorter) form.
Make the buffer large enough for both forms, and reject anything that's
still too large.

Found by Inet6AddressTest.
libcore/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp