httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: apreq_param with uploads
Date Wed, 02 Jun 2004 11:30:27 GMT
Bojan Smojver <bojan@rexursive.com> writes:

> I've bumped into this one by accident and it is related to calling
> apreq_param() on something that is an upload (i.e. a file passed through
> multipart/form-data). If apreq_param() is called on such a parameter
> name, the pointer returned by the call will be invalid (literally,
> value 0x3), causing a segfault on access. I'm guessing that although
> "val" is not NULL on return in that function, the pointer arithmetic
> in apreq_strtoval() and apreq_value_to_param() macros may contribute
> to the eventual invalid pointer value.

Which version of libapreq2 are you talking about?  Which pointer
is 0x3- the return value of apreq_param, or the param's bucket brigade?
Maybe some example code would help?

> I'm not sure if this should be fixed by calling apreq_upload() on any
> such parameters from apreq_parem(), or just documented that one needs
> to call apreq_upload() or apreq_uploads() first to actually generate
> those values, which then avoids the invalid pointer and the segfault.

I don't think documenting this behavior is a good solution- we should
try to fix it first.

-- 
Joe Schaefer


Mime
View raw message