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:
Nick Kralevich
2013-05-02 14:31:51 -07:00
parent e4ac8feb58
commit 532d6f09b1
11 changed files with 11 additions and 11 deletions

View File

@@ -45,7 +45,7 @@
extern "C" size_t __strlcat_chk(char *dest, const char *src,
size_t supplied_size, size_t dest_len_from_compiler)
{
if (supplied_size > dest_len_from_compiler) {
if (__predict_false(supplied_size > dest_len_from_compiler)) {
__fortify_chk_fail("strlcat buffer overflow", 0);
}