aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Wrapper.pm15
-rw-r--r--debian/changelog6
2 files changed, 17 insertions, 4 deletions
diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
index 4c99cdaa0..583841d6c 100644
--- a/IkiWiki/Wrapper.pm
+++ b/IkiWiki/Wrapper.pm
@@ -189,16 +189,23 @@ int i=0;
void addenv(char *var, char *val) {
char *s=malloc(strlen(var)+1+strlen(val)+1);
- if (!s)
+ if (!s) {
perror("malloc");
- sprintf(s, "%s=%s", var, val);
- newenviron[i++]=s;
+ exit(1);
+ }
+ else {
+ sprintf(s, "%s=%s", var, val);
+ newenviron[i++]=s;
+ }
}
void set_cgilock_fd (int lockfd) {
char *fd_s=malloc(8);
sprintf(fd_s, "%i", lockfd);
- setenv("IKIWIKI_CGILOCK_FD", fd_s, 1);
+ if (setenv("IKIWIKI_CGILOCK_FD", fd_s, 1) != 0) {
+ perror("setenv");
+ exit(1);
+ }
}
int main (int argc, char **argv) {
diff --git a/debian/changelog b/debian/changelog
index 89e587737..6ca649854 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ikiwiki (3.20150108) UNRELEASED; urgency=medium
+
+ * Fix NULL ptr deref on ENOMOM in wrapper. (Thanks, igli)
+
+ -- Joey Hess <id@joeyh.name> Sat, 24 Jan 2015 23:59:20 -0400
+
ikiwiki (3.20150107) experimental; urgency=medium
[ Joey Hess ]