X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/5f6f9a1beab327be2728d44c1996408176f6800e..4f0b10c13d8d85e6ad1818f5ada84477f43df43a:/IkiWiki/Receive.pm diff --git a/IkiWiki/Receive.pm b/IkiWiki/Receive.pm index 332ba7c2c..f985f560b 100644 --- a/IkiWiki/Receive.pm +++ b/IkiWiki/Receive.pm @@ -26,6 +26,8 @@ sub genwrapper () { my $ret=<<"EOF"; { int u=getuid(); + /* 3 characters per byte is certainly enough */ + char uid_string[sizeof(u) * 3 + 1]; EOF $ret.="\t\tif ( ". join("&&", map { @@ -46,8 +48,8 @@ EOF while (read(0, &buf, 256) != 0) {} exit(0); } - asprintf(&s, "%i", u); - addenv("CALLER_UID", s); + snprintf(uid_string, sizeof(uid_string), "%i", u); + addenv("CALLER_UID", uid_string); } EOF return $ret;