httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <>
Subject Re: mod_rewrite and NDBM
Date Wed, 02 Dec 1998 08:13:57 GMT

In article <> you wrote:

> Looking at the mod_rewrite code from 1.3.3 everything looks fine in
> the lookup_map_dbmfile with the exception that I cannot figure out
> *why* this piece of code is as it is:

>     dbmkey.dsize = (strlen(key) < sizeof(buf) - 1 ?
>                     strlen(key) : sizeof(buf)-1);

Woouaaa, you're right. What's this? Seems like someone who has added the range
checkings to mod_rewrite (I think it was somewhere when things like ap_cpystrn
were introduced, etc.) did it too fast at this code location. It was added by
someone to prevent a buffer-overflow in the later memcpy(). But of course this
check has to be done for memcpy() and not before the dbm_fetch. That's a bug
although it should not occur in practice because MAX_STRING_LEN is usually
longer than any looked up key. Nevertheless I'll immediately fix it. Thanks
for complaining.

And good to hear that your DBM problems were related to GDBM 
and not a bug in our code ;-)
                                       Ralf S. Engelschall

View raw message