fp_ident: fix incorrect length in strncat() call.

strncat' last argument is the remaining size of the buffer given in the
first argument, not the total buffer length.

Reported-by: contact@oppida.fr via clamav #11166
Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
This commit is contained in:
Steven Morgan 2015-02-25 23:16:54 +01:00 committed by Steffen Jaeckel
parent 060b2c5697
commit 522a092ffb

View File

@ -74,7 +74,7 @@ const char *fp_ident(void)
if (sizeof(fp_digit) == sizeof(fp_word)) {
strncat(buf, "WARNING: sizeof(fp_digit) == sizeof(fp_word), this build is likely to not work properly.\n",
sizeof(buf)-1);
sizeof(buf) - strlen(buf) - 1);
}
return buf;
}