From: Richard Guenther Date: Thu, 20 Jul 2006 01:41:08 +0000 (+1000) Subject: Fix off-by-one error in rpcgen X-Git-Tag: nfs-utils-1-0-10~4 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=39c22863ac568d257ef197dbc31bef45c596e8ca;p=nfs-utils.git Fix off-by-one error in rpcgen We obviously need to allocate space for the terminating nul too. --- diff --git a/tools/rpcgen/rpc_cout.c b/tools/rpcgen/rpc_cout.c index 377ba0b..a9d1456 100644 --- a/tools/rpcgen/rpc_cout.c +++ b/tools/rpcgen/rpc_cout.c @@ -692,7 +692,7 @@ upcase(char *str) char *ptr, *hptr; - ptr = (char *) malloc(strlen(str)); + ptr = (char *) malloc(strlen(str)+1); if (ptr == (char *) NULL) { f_print(stderr, "malloc failed \n"); exit(1);