[strongSwan-dev] [PATCH] printf-hook-builtin: fix invalid memory access

Tobias Brunner tobias at strongswan.org
Mon Jul 27 11:25:40 CEST 2015

Hi Timo,

Thanks for the report.

> +								slen = prec ? strnlen(sarg, prec) : strlen(sarg);

`prec` defaults to -1 so that check is not correct.  Also, the string
returned by strerror() is always null terminated (%m case) and we don't
actually use this with a precision.

I pushed a fix for this to the printf-builtin-strlen branch [1].  Let me
know if that works for you.


[1] https://git.strongswan.org/?p=strongswan.git;a=commitdiff;h=944e99d5

More information about the Dev mailing list