www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Per Ekman <...@pdc.kth.se>
Subject build/9710: Invalid pointer arithmetic in shm.c causes compilation to fail.
Date Mon, 04 Feb 2002 13:45:41 GMT

>Number:         9710
>Category:       build
>Synopsis:       Invalid pointer arithmetic in shm.c causes compilation to fail.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Mon Feb 04 05:50:00 PST 2002
>Originator:     pek@pdc.kth.se
>Release:        2.0.31
Irix 6.5.13f 
MIPSpro Compilers: Version
srclib/apr/shmem/unix/shm.c tries to do pointer arithmetic with a pointer to
void which is illegal in ANSI C as far as I can tell.

I did this :

--- srclib/apr/shmem/unix/shm.c.orig    Mon Feb  4 14:30:24 2002
+++ srclib/apr/shmem/unix/shm.c Mon Feb  4 14:30:35 2002
@@ -189,7 +189,7 @@ APR_DECLARE(apr_status_t) apr_shm_create
         /* store the real size in the metadata */
         *(apr_size_t*)(new_m->base) = new_m->realsize;
         /* metadata isn't usable */
-        new_m->usable = new_m->base + sizeof(apr_size_t);
+        new_m->usable = (char *)new_m->base + sizeof(apr_size_t);
         apr_pool_cleanup_register(new_m->pool, new_m, shm_cleanup_owner,
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]

View raw message