GNOME Bugzilla – Bug 92492
g_string_printf() and embedded NULs
Last modified: 2011-02-18 16:13:45 UTC
g_string_printf() could be used in cases where the result of printf() includes embedded NULs, and we support embedded NULs for GString. But g_string_printf() uses g_strdup_vprintf() which doesn't return the length, so we end up using strlen(). See: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=73425 Fixing this would require g_strdup_vprintf_len(&str, &len, fmt, args) or something.
Created attachment 16575 [details] [review] patch and testcase
The patch also fixes bug 101997.