2013/8/26 Jeffrey Johnson <n3...@me.com>

>
> On Aug 26, 2013, at 3:17 PM, Per Øyvind Karlsen wrote:
>
> > This patch ensures that strings has a null terminator at end, otherwise
> strings passed to mireRegexec might be missing it.
> >
>
> Is there a specific problem here? DO you have a reproducer?
>
I need to it out of my memory how to exactly reproduce, but IIRC the
specific problem comes from keys from berkeley db with no null terminator,
leading to trouble when trying to check it's length with strlen()..
So in order to work around this, memory with room for the additional null
terminator is allocated with the string copied into.

As it's a two year old collection of patches piled up, there's obviously
some details my memory is rather vague on, but I'll try see if I can come
up with the reproducer, but I can't make any promises of when that'll be.

> The use of alloca tells me that I applied a band-aid here for some
> reason I've long since forgot.
>
> The real problem (and fix) is likely elsewhere, not here, imho.

Yeah, I seem to recall having the exact same feeling, but maybe the details
coming from the top of my head might be sufficient for you to both figure
out and understand the issue, while also coming up with a better solution.
:)

--
Regards,
Per Øyvind

Reply via email to