]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
fix another unchecked malloc
authorJoey Hess <joeyh@joeyh.name>
Sun, 25 Jan 2015 04:10:34 +0000 (00:10 -0400)
committerJoey Hess <joeyh@joeyh.name>
Sun, 25 Jan 2015 04:10:34 +0000 (00:10 -0400)
<joeyh> any parrticular reason 12?
<igli> well maximum a 32-bit can go is 10 chars
<igli> so one for \0 and round up to 4

IkiWiki/Wrapper.pm

index 583841d6cb558f3c7b3632fc389f1e5dd3a6bb42..69500029cd20ae104bac6160dc8f1c18cb5dfa3d 100644 (file)
@@ -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");