From d6ce76b54bfd8517c26a090adf004c0728713bda Mon Sep 17 00:00:00 2001 From: ghelmer Date: Thu, 7 Jun 2001 20:05:18 +0000 Subject: Fix the number of bytes allocated by realloc when more space is needed for the vector of arguments. MFC after: 1 week --- libexec/telnetd/sys_term.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libexec/telnetd') diff --git a/libexec/telnetd/sys_term.c b/libexec/telnetd/sys_term.c index c2fb6fc..f5163cb 100644 --- a/libexec/telnetd/sys_term.c +++ b/libexec/telnetd/sys_term.c @@ -1765,7 +1765,7 @@ addarg(argv, val) if (cpp == &argv[(long)argv[-1]]) { --argv; *argv = (char *)((long)(*argv) + 10); - argv = (char **)realloc(argv, (long)(*argv) + 2); + argv = (char **)realloc(argv, sizeof(*argv) * ((long)(*argv) + 2)); if (argv == NULL) return(NULL); argv++; -- cgit v1.1