Disable stringop-truncation false positive warnings on gcc 8.

Strings in struct utmp/utmpx are not guaranteed to be NUL-terminated.
This commit is contained in:
Todd C. Miller
2019-07-30 12:42:07 -06:00
parent aa200cda6a
commit dfc32e5b3e

View File

@@ -52,6 +52,14 @@
#include "sudo.h"
#include "sudo_exec.h"
/*
* GCC 8 warns about strncpy() where the size field is the size of the buffer.
* However, strings in utmp may not be NUL terminated so this usage is correct.
*/
#if __GNUC_PREREQ__(8, 0)
# pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
/*
* Simplify handling of different utmp types.
*/