aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2015-01-25 00:00:40 -0400
committerJoey Hess <joeyh@joeyh.name>2015-01-25 00:00:40 -0400
commitfe0eaf1870d3b992ef3caa8c49c3b22e965ac36b (patch)
tree99872f8d139d91060e1018788a702012828c6fb3
parent8c35714a37095c720308478660001a5fd9db5bfc (diff)
downloadikiwiki-fe0eaf1870d3b992ef3caa8c49c3b22e965ac36b.tar
ikiwiki-fe0eaf1870d3b992ef3caa8c49c3b22e965ac36b.tar.gz
Fix NULL ptr deref on ENOMOM in wrapper. (Thanks, igli)
Probably not exploitable, but who knows..
-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 ]