summaryrefslogtreecommitdiff
path: root/adb/file_sync_client.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2016-02-23 18:02:20 -0800
committerChristopher Ferris <cferris@google.com>2016-02-25 12:46:44 -0800
commit626efb78a6e1f0b2d637368f1eba175cfe89fb1c (patch)
tree87cc0e2e10920dd703a40c5260214f9de7b4eb7d /adb/file_sync_client.cpp
parent978cda5cc64bd0c0fe1915074bbf6237b2214faa (diff)
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 Change-Id: I1b64ddde6f5ff2ec7f6428b998d21d41a1236b14
Diffstat (limited to 'adb/file_sync_client.cpp')
0 files changed, 0 insertions, 0 deletions