Skip to content
Snippets Groups Projects
Commit a9b3e1c3 authored by Nadav Har'El's avatar Nadav Har'El Committed by Pekka Enberg
Browse files

Fix error in __vsnprintf_chk()


__vsnprintf_chk() passed the wrong length argument to the vsnprintf()
call. I'm not aware of any specific bug this solves, but I found this
error while auditing the *_chk() functions to figure out why "rogue"
works when compiled with -DUSE_FORTIFY_LEVEL=1 but not with
USE_FORTIFY_LEVEL=2.

Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 8a48cb55
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ int __vsnprintf_chk(char *s, size_t maxlen, int flags, size_t slen,
if (slen < maxlen) {
abort();
}
return vsnprintf(s, slen, format, args);
return vsnprintf(s, maxlen, format, args);
}
int __sprintf_chk(char *s, int flags, size_t slen, const char *format, ...)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment