Jim Meyering wrote:
> Under memory pressure, the use of strdup in strstr_rs could return NULL,
> and that return value would then be dereferenced.
>
> The following change replaces that function with this far
> simpler one and removes a second copy of the original.
>
> char *strstr_rs (const char *haystack, int byte)
> {
>       const char *end_address = strchr (haystack, byte);
>       if (end_address) {
>               end_address += 1; /* skip past { or = */
>               end_address += strspn (end_address, " \t");
>       }
>
>       return ((char *) end_address);
> }
>
> Since the goal was just to remove the potential NULL-dereference,
> I tried to keep this small, I didn't rename the function (it now looks
> more like strchr than strstr), but can do that, too, if you'd like.
> strchr_rs?

Ping?
That patch is still needed:

    http://marc.info/?l=openais&m=123783073728504&w=2

I'll rebase it tomorrow.
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to