diff options
Diffstat (limited to 'usr.bin/mkstr/mkstr.c')
-rw-r--r-- | usr.bin/mkstr/mkstr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/mkstr/mkstr.c b/usr.bin/mkstr/mkstr.c index ab87c73..55d6023 100644 --- a/usr.bin/mkstr/mkstr.c +++ b/usr.bin/mkstr/mkstr.c @@ -191,6 +191,8 @@ copystr(void) char *cp = buf; for (;;) { + if (cp == buf + sizeof(buf) - 2) + errx(1, "message too long"); c = getchar(); if (c == EOF) break; |