Avoid confusing "read prevented write" log messages.

Moving to a "function: message" style avoids ambiguity.

Change-Id: If9d590e50265c61725d3673bd03796e65edd2d5e
This commit is contained in:
Elliott Hughes
2013-10-15 16:43:38 -07:00
parent dc9d8d050a
commit d1eda33f01
22 changed files with 187 additions and 237 deletions

View File

@@ -41,13 +41,13 @@
* This strcpy check is called if _FORTIFY_SOURCE is defined and
* greater than 0.
*/
extern "C" char *__strcpy_chk (char *dest, const char *src, size_t dest_len) {
// TODO: optimize so we don't scan src twice.
size_t src_len = strlen(src) + 1;
if (__predict_false(src_len > dest_len)) {
__fortify_chk_fail("strcpy prevented write past end of buffer",
BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW);
}
extern "C" char* __strcpy_chk (char* dest, const char* src, size_t dest_len) {
// TODO: optimize so we don't scan src twice.
size_t src_len = strlen(src) + 1;
if (__predict_false(src_len > dest_len)) {
__fortify_chk_fail("strcpy: prevented write past end of buffer",
BIONIC_EVENT_STRCPY_BUFFER_OVERFLOW);
}
return strcpy(dest, src);
return strcpy(dest, src);
}