Subject: | mod_perl1 patch to prevent core dump |
Here's a patch for a problem I found with mod_perl1 when another module
uses setenv() with a null pointer as a value.
One could of course argue that this is a stupid thing to do in the first
place, but I've seen this happening with an obscure module and it's
probably good practice to catch this case instead of having the server
core dump.
--- src/modules/perl/Apache.xs Tue Sep 16 12:51:06 2003
+++ src/modules/perl/Apache.xs Fri Mar 16 16:20:33 2007
@@ -1325,7 +1325,7 @@
table_entry *elts = (table_entry *)arr->elts;
SP -= items;
for (i = 0; i < arr->nelts; ++i) {
- if (!elts[i].key) continue;
+ if (!elts[i].key || !elts[i].val) continue;
PUSHelt(elts[i].key, elts[i].val, 0);
}
PUTBACK;
Would be great if you could add this to the next mod_perl1 release. Thanks!
-- Mike