roxen.lists.roxen.general

Subject Author Date
[PATCH 05/17] Avoid null-dereference when the file doesn't exist Stephen R. van den Berg <srb[at]cuci[dot]nl> 20-01-2009
 (pathinfo)

---

 server/modules/filters/whitespace_remover.pike |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/server/modules/filters/whitespace_remover.pike
b/server/modules/filters/whitespace_remover.pike
index 4674e58..3a99e88 100644
--- a/server/modules/filters/whitespace_remover.pike
+++ b/server/modules/filters/whitespace_remover.pike
@@ -54,11 +54,12 @@ array(string) verbatim(Parser.HTML p, mapping(string:string)
args, string c) {
 
 mapping filter(mapping result, RequestID id)
 {
+  if(!result)
+    return 0;
   string|array(string) type = result->type;
   if (arrayp(type))
     type = type[0];
-  if(!result
-  || !has_prefix(type||"", "text/html")
+  if(!has_prefix(type||"", "text/html")
   || (id->misc->moreheads && id->misc->moreheads["Content-Type"] &&
       id->misc->moreheads["Content-Type"] != "text/html")
   || !stringp(result->data)