httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r774483 - /httpd/httpd/trunk/modules/mem/mod_sharedmem.c
Date Wed, 13 May 2009 18:34:20 GMT
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);



Mime
View raw message