diff options
-rw-r--r-- | sessreg.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -192,6 +192,12 @@ sysnerr (int x, const char *s) return x; } +/* + * While this looks like it could be replaced with strlcpy() on platforms + * that have it, we're sticking with strncpy() so that we zero out the + * whole buffer to avoid writing garbage to the fixed length fields in the + * utmp/wtmp files, since strlcpy() does not write past the \0 terminator. + */ static void safe_strncpy(char *dest, const char *src, size_t n) { |