diff options
-rw-r--r-- | usr.bin/xstr/xstr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/xstr/xstr.c b/usr.bin/xstr/xstr.c index 2ffbc72..6195ff2 100644 --- a/usr.bin/xstr/xstr.c +++ b/usr.bin/xstr/xstr.c @@ -231,6 +231,8 @@ yankstr(char **cpp) static char tmp[] = "b\bt\tr\rn\nf\f\\\\\"\""; while ((c = *cp++)) { + if (dp == dbuf + sizeof(dbuf) - 3) + errx(1, "message too long"); switch (c) { case '"': |