Avoid confusing "read prevented write" log messages.
Moving to a "function: message" style avoids ambiguity. Change-Id: If9d590e50265c61725d3673bd03796e65edd2d5e
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user