You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Per Ekman <pe...@pdc.kth.se> on 2002/02/04 14:45:41 UTC
build/9710: Invalid pointer arithmetic in shm.c causes compilation to fail.
>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
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Mon Feb 04 05:50:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: pek@pdc.kth.se
>Release: 2.0.31
>Organization:
apache
>Environment:
Irix 6.5.13f
MIPSpro Compilers: Version 7.3.1.1m
>Description:
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.
>How-To-Repeat:
>Fix:
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,
apr_pool_cleanup_null);
>Release-Note:
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@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! ]