[svn:mod_parrot] r283 - mod_parrot/trunk/src

[email protected]
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Thu Dec 20 10:34:19 2007
New Revision: 283

Modified:
   mod_parrot/trunk/src/nci.c

Log:
check for NULL context before using it


Modified: mod_parrot/trunk/src/nci.c
==============================================================================
--- mod_parrot/trunk/src/nci.c	(original)
+++ mod_parrot/trunk/src/nci.c	Thu Dec 20 10:34:19 2007
@@ -37,6 +37,7 @@
     modparrot_context *ctxp;
 
     ctxp = get_interp_ctx(interp);
+    if (!ctxp) return NULL;
     return(ctxp->r);
 }
 
@@ -45,6 +46,7 @@
     modparrot_context *ctxp;
 
     ctxp = get_interp_ctx(interp);
+    if (!ctxp) return NULL;
     return(ctxp->pconf);
 }
 
@@ -53,6 +55,7 @@
     modparrot_context *ctxp;
 
     ctxp = get_interp_ctx(interp);
+    if (!ctxp) return NULL;
     return(ctxp->ptemp);
 }
 
@@ -61,6 +64,7 @@
     modparrot_context *ctxp;
 
     ctxp = get_interp_ctx(interp);
+    if (!ctxp) return NULL;
     return(ctxp->plog);
 }
 
@@ -69,6 +73,7 @@
     modparrot_context *ctxp;
 
     ctxp = get_interp_ctx(interp);
+    if (!ctxp) return NULL;
     return(ctxp->pchild);
 }
 
@@ -77,6 +82,7 @@
     modparrot_context *ctxp;
 
     ctxp = get_interp_ctx(interp);
+    if (!ctxp) return NULL;
     return(ctxp->s);
 }
 
@@ -85,6 +91,7 @@
     modparrot_context *ctxp;
 
     ctxp = get_interp_ctx(interp);
+    if (!ctxp) return NULL;
     return(ctxp->c);
 }
 
@@ -93,6 +100,7 @@
     modparrot_context *ctxp;
 
     ctxp = get_interp_ctx(interp);
+    if (!ctxp) return NULL;
     return(ctxp->csd);
 }
 
@@ -129,6 +137,7 @@
     modparrot_context *ctxp;
 
     ctxp = get_interp_ctx(interp);
+    if (!ctxp) return HTTP_INTERNAL_SERVER_ERROR;
     status = ap_get_basic_auth_pw(r, (const char **)&pw);
     spw = Parrot_new_string(ctxp->interp,
         pw ? pw : "", pw ? strlen(pw) : 0, "iso-8859-1", 0);
@@ -145,6 +154,7 @@
     char *tmp;
 
     ctxp = get_interp_ctx(interp);
+    if (!ctxp) return 0;
     interpreter = ctxp->interp;
 
     /* will this work for binary data??? */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.