Use __predict_false on some fortify methods.
Give the compiler some hints that these error conditions are unlikely to occur in practice. Change-Id: Ifaf7322a12120ef663c8315c1a18c2dcbe4bda23
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
extern "C" char *__strncpy_chk (char *dest, const char *src,
|
||||
size_t len, size_t dest_len)
|
||||
{
|
||||
if (len > dest_len) {
|
||||
if (__predict_false(len > dest_len)) {
|
||||
__fortify_chk_fail("strncpy buffer overflow",
|
||||
BIONIC_EVENT_STRNCPY_BUFFER_OVERFLOW);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user