diff options
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/telnetd/telnetd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c index 361e590777a..2713988ee66 100644 --- a/libexec/telnetd/telnetd.c +++ b/libexec/telnetd/telnetd.c @@ -783,7 +783,8 @@ show_issue(void) f = fopen("/etc/issue", "r"); if(f){ while(fgets(buf, sizeof(buf)-2, f)){ - strcpy(buf + strcspn(buf, "\r\n"), "\r\n"); + size_t off = strcspn(buf, "\r\n"); + strlcpy(buf + off, "\r\n", sizeof(buf) - off); writenet((unsigned char*)buf, strlen(buf)); } fclose(f); |