You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2009/05/13 20:34:20 UTC

svn commit: r774483 - /httpd/httpd/trunk/modules/mem/mod_sharedmem.c

Author: jim
Date: Wed May 13 18:34:19 2009
New Revision: 774483

URL: http://svn.apache.org/viewvc?rev=774483&view=rev
Log:
error detection

Modified:
    httpd/httpd/trunk/modules/mem/mod_sharedmem.c

Modified: httpd/httpd/trunk/modules/mem/mod_sharedmem.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mem/mod_sharedmem.c?rev=774483&r1=774482&r2=774483&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mem/mod_sharedmem.c (original)
+++ httpd/httpd/trunk/modules/mem/mod_sharedmem.c Wed May 13 18:34:19 2009
@@ -449,9 +449,14 @@
 {
 
     void *ptr;
-    char *inuse = (slot->base + (slot->size * slot->num));
+    char *inuse;
     apr_status_t ret;
 
+    if (!slot) {
+        return APR_ENOSHMAVAIL;
+    }
+
+    inuse = (slot->base + (slot->size * slot->num));
     if (!inuse[id]) {
         return APR_ENOSHMAVAIL;
     }
@@ -467,9 +472,14 @@
 {
 
     void *ptr;
-    char *inuse = (slot->base + (slot->size * slot->num));
+    char *inuse;
     apr_status_t ret;
 
+    if (!slot) {
+        return APR_ENOSHMAVAIL;
+    }
+
+    inuse = (slot->base + (slot->size * slot->num));
     if (!inuse[id]) {
         return APR_ENOSHMAVAIL;
     }
@@ -500,6 +510,7 @@
     if (!slot) {
         return APR_ENOSHMAVAIL;
     }
+
     inuse = (slot->base + (slot->size * slot->num));
 
     SLOTMEM_LOCK(slot->smutex);
@@ -526,6 +537,7 @@
     if (!slot) {
         return APR_ENOSHMAVAIL;
     }
+
     inuse = (slot->base + (slot->size * slot->num));
 
     SLOTMEM_LOCK(slot->smutex);