From 36526fd90e4aa69a246ff1c56b09fe57af16a26d Mon Sep 17 00:00:00 2001 From: tjr Date: Fri, 1 Nov 2002 12:09:05 +0000 Subject: Zap another buffer overflow, this time in the parser. MFC after: 2 weeks --- usr.bin/mkstr/mkstr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'usr.bin/mkstr/mkstr.c') 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; -- cgit v1.1