From 522a092ffbba8040d2de8fcb583fc186cf34c915 Mon Sep 17 00:00:00 2001 From: Steven Morgan Date: Wed, 25 Feb 2015 23:16:54 +0100 Subject: [PATCH] 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 --- src/misc/fp_ident.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/fp_ident.c b/src/misc/fp_ident.c index e0a7907..98c5cc4 100644 --- a/src/misc/fp_ident.c +++ b/src/misc/fp_ident.c @@ -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; }