From 6a46c2cf55c9e9c1cb2ba3d2f0a650ef65dd649b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2015 00:10:34 -0400 Subject: [PATCH] fix another unchecked malloc any parrticular reason 12? well maximum a 32-bit can go is 10 chars so one for \0 and round up to 4 --- IkiWiki/Wrapper.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 583841d6c..69500029c 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -200,7 +200,7 @@ void addenv(char *var, char *val) { } void set_cgilock_fd (int lockfd) { - char *fd_s=malloc(8); + char fd_s[12]; sprintf(fd_s, "%i", lockfd); if (setenv("IKIWIKI_CGILOCK_FD", fd_s, 1) != 0) { perror("setenv");