platform_system_core/libcutils/tests
Christopher Ferris 82d84897b1 Fix incorrect handling of snprintf return value.
The code assumed that snprintf would never return a value less than
the passed in size of the buffer. This is not accurate, so fix all
of the places this assumptions is made. Also, if the name is too large,
then truncate just the name to make everything fit.

Added a new set of tests for this code. Verified that the old code passes
on the _normal and _exact version of the tests, but fails with the
FORTIFY error on the _truncated version of the tests. All tests pass
on the new code.

Bug: 27324359

(cherry picked from commit 626efb78a6)

Change-Id: Iba60a926cf5a1d6b517a6bfd8c797d724f093010
2016-02-25 14:02:00 -08:00
..
Android.mk Fix incorrect handling of snprintf return value. 2016-02-25 14:02:00 -08:00
MemsetTest.cpp Make allocations use unique_ptr. 2015-10-14 14:03:29 -07:00
PropertiesTest.cpp cutils: Add property_get_bool, _get_int32, _get_int64 2014-06-20 20:01:49 +00:00
sockets_test.cpp libcutils/fastboot: improve multi-buffer write. 2016-02-03 10:01:38 -08:00
test_str_parms.cpp Move all libcutils tests into the gtests. 2015-04-02 14:25:55 -07:00
trace-dev_test.cpp Fix incorrect handling of snprintf return value. 2016-02-25 14:02:00 -08:00