From 206e749fc33982847124b3714c2749f80e3b9407 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 22 Sep 1997 20:25:34 +0000 Subject: Prevent buffer overruns. svn path=/trunk/; revision=1384 --- driver.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index 04b6683b..79a95b64 100644 --- a/driver.c +++ b/driver.c @@ -562,8 +562,9 @@ int num; /* index of message */ } set_timeout(ctl->server.timeout); - /* leave extra room for reply_hack to play with */ - line = (char *) realloc(line, strlen(line) + strlen(buf) + HOSTLEN + 1); + + line = (char *) realloc(line, strlen(line) + strlen(buf) +1); + strcat(line, buf); if (line[0] == '\r' && line[1] == '\n') break; @@ -671,7 +672,7 @@ int num; /* index of message */ } if (ctl->rewrite) - reply_hack(line, realname); + line = reply_hack(line, realname); if (!headers) { -- cgit v1.2.3