* Store the output of a length variable in size_t.
* Annotate unsigned constant values as such.
Bug: 27384813
Change-Id: I8504c0a8f5840d4d42e5c0df797a4e5d02d13eb9
The fix is to use the C++ empty struct initialization {} instead of the
C-style {0}.
Bug: 27378717
Change-Id: I36896d1202bf30b5db5689ac13acaff3b3f1b30b
Sometimes new users/groups get added in internal branches, and the list
gets out of sync. Add a comment to prompt developers to add users in
AOSP.
Bug: None
Change-Id: I5b2df391902b842f1af8a377c8eac4cdb36a0518
Previously, for `adb pull $remote $local`, we would do the equivalent of
mkdir -p on `dirname $local`. This patch changes the behavior to only
creating directories that are being pulled, like scp.
Bug: http://b/27362811
Change-Id: I79f975ee9f2d9bc9e8be6a7c4f2de6d7ae2d2d23
The two types of fixes are:
* Assign expected non-negative values to unsigned int variables.
* Annotate constant expected integer values as unsigned.
Bug: 27378717
Change-Id: Ifc13beedd61a28ed685e1a06a7cefe99072e3345
The user collector test creates several symlinks to the temporary
directory that it doesn't unlink. Fix it.
BUG=27365098
TEST=run `crash_reporter_tests`, tests pass, no symlinks are left behind
Change-Id: I7ad24c528dc842e17fa3569ea010f43d34e0bd75
This change is a workaround for apps linking
libutils statically and dynamically which causes
them to crash for newer version of Android.
Bug: http://b/27313399
Change-Id: I47ac4146041b6eeef03cb605ea436719d552ec8f
(cherry picked from commit 2c7960c8d9)
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
Instead of using chown, use the symlink safe lchown.
Instead of using chmod, use the symlink safe fchmodat
with AT_SYMLINK_NOFOLLOW.
Fix a bug where the SELinux filesystem creation context may
not be restored, and some memory not freed, if bind() fails.
Check the return values from the chown/chmod calls and unlink
the files if it ever fails.
(cherrypicked from commit ab5629c197)
Bug: 27337831
Change-Id: I28c5f4dee55aa706437eb51ad403c1fbf56138de
Switch to the event list library to compose the associated event.
SideEffects: Instead of composing event on a stack buffer of 512
bytes in size, a PAGE is allocated temporarily.
Bug: 27356456
Change-Id: Ic15a87f49385834c2287ed82c26439b2c5eb4f77
Add a test to confirm exact expected content using the testframe
setup for the events log handler. Remove dependency on 512 truncation
in liblog->
android_errorWriteWithInfoLog__android_logger_list_read__data_too_large
to something more liberal.
Bug: 27356456
Change-Id: I8a53ad3a16cf16b14856efe5b95417e857c7e09b
android_log_write_string8_len(android_log_context ctx,
const char *value, size_t maxlen)
Caps the supplied string to a maxlen length. Alter API to handle
a NULL pointer for the value string for this and
android_log_write_string8() and instead of returning -EINVAL,
act like a null string "" was supplied to preserve the list
location. API is also changed to report the number of characters
actually placed into the android_log_context.
Bug: 27356456
Bug: 19235719
Change-Id: I6a03d405eac1d741555dd05555513ec691e7a46e
GGLAssembler inherits a reset method from two parent classes, but it
provides a separate reset method with a different signature, thus hiding
the inherited reset methods.
The fix is to explicitly hide the inherited reset methods as private.
Bug: 27346663
Change-Id: Ic64b00acb6d77fb791cfdeade9ef7e20148817c1
Move the bdk_version, product_id, and product_version metadata
population into the base crash_collector class so that all
colletors correctly report those fields in crash reports.
BUG=27344416
TEST=crash_reporter_tests passes.
Change-Id: I050053055f197d01661a1442e3cdcccc53c1c8fe
Move the fdevent for the framework authentication connection out of
atransport into its own static variable in adb_auth_client, since its
lifetime is completely unrelated to that of the USB connection.
Bug: http://b/27297963
Change-Id: Ie6180d0b59d133120c5755e239e76ab33ed3cc1d
Shift responsibility of preloading native libraries to the user
of the library. This lets applications that do not use jni but
depend on libnative_loader.so to avoid unnecessary preloads of
public libraries which could be expensive.
Bug: http://b/27245894
Change-Id: I12a8100de5da639c068769bca21ecebff2b2d538
(cherry picked from commit 426799d770)