From d3b215fb83dd1680d11abd1622623eb1ae5c3005 Mon Sep 17 00:00:00 2001 From: Jeff Connelly Date: Mon, 2 Jun 2008 17:44:44 -0700 Subject: [PATCH] cotp: fix off-by-one bug in expanding input buffer. --- cotp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cotp.c b/cotp.c index 170d79d..3c5b3b7 100644 --- a/cotp.c +++ b/cotp.c @@ -97,7 +97,7 @@ char *read_input(unsigned int *size) input[i++] = fgetc(stdin); if (input[i - 1] == EOF) break; - if (i > buffer_size) { + if (i >= buffer_size) { buffer_size += 1024; input = realloc(input, buffer_size); if (!input) { -- 2.11.4.GIT