[PATCH] wmc: Increate allocated size to match \0 (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Nov 12 02:04:51 CST 2011


Hi,

Allocationsize calculation missed leading \0.

Ciao, Marcus
---
 tools/wmc/wmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/wmc/wmc.c b/tools/wmc/wmc.c
index 837cfa6..c9ad9c4 100644
--- a/tools/wmc/wmc.c
+++ b/tools/wmc/wmc.c
@@ -164,7 +164,7 @@ int main(int argc,char *argv[])
 
 	/* First rebuild the commandline to put in destination */
 	/* Could be done through env[], but not all OS-es support it */
-	cmdlen = 4; /* for "wmc " */
+	cmdlen = 5; /* for "wmc " and \0 */
 	for(i = 1; i < argc; i++)
 		cmdlen += strlen(argv[i]) + 1;
 	cmdline = xmalloc(cmdlen);
-- 
1.7.3.4




More information about the wine-patches mailing list