From: Joey Hess Date: Sun, 25 Jan 2015 04:10:34 +0000 (-0400) Subject: fix another unchecked malloc X-Git-Tag: debian/3.20150329~116 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/6a46c2cf55c9e9c1cb2ba3d2f0a650ef65dd649b?ds=inline 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 --- 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");