[SSSD] [PATCH] Don't pass user input as a printf format string argument

Stef Walter stefw at redhat.com
Tue Jan 7 20:31:04 UTC 2014


On 07.01.2014 20:34, Simo Sorce wrote:
> Ok fine, makes sense once explained (need this explanation in the
> docs/headers), but then use a different name.
> 
> If I see safe_snprintf, I assume the full format capabilities of
> snprintf, the name in this case is misleading.
> 
> That said I am not sure what's the best name you could use...
> maybe strextend ? and the astrextend variant for allocated ones ?

I've called it safe_str_snprintf (and so on). Hopefully that's clear
enough. It is processing the familiar printf syntax, so it makes sense
to have that somewhere.

Updated header documentation as requested, and made other fixes from
your earlier review.

Cheers,

Stef

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-util-A-safe-printf-for-user-provided-format-strings.patch
Type: text/x-patch
Size: 21607 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20140107/c20d0400/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-NSS-Don-t-use-printf-3-on-user-provided-strings.patch
Type: text/x-patch
Size: 25720 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20140107/c20d0400/attachment-0001.bin>


More information about the sssd-devel mailing list