[Mono-bugs] [Bug 682963] gstring.c:116: assertion 'val != NULL' failed

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Mar 28 20:59:09 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=682963

https://bugzilla.novell.com/show_bug.cgi?id=682963#c4


--- Comment #4 from James Bellinger <xocotl at gmail.com> 2011-03-29 00:59:08 UTC ---
By the way, in append_class_name, res up until the point of assert is

+        str    0x02433050
"<PrivateImplementationDetails>{9DEADCAC-501B-4E84-B1DB-0CCF682EF16B}."    char
*

Line 87 there is

g_string_append_printf (res, "%s", class->name);

class->name is

+        name    0x0123bb4c ""    const char *

I think the bug here is that ret = g_strdup_vprintf (format, args), args is
passing a zero length string with format %s. That passes into vasprintf
eventually, and there is the line

    if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {

Failure for _vscprintf and vsnprintf return negative numbers, however, and
length 0 should allocate one byte for the null terminator. So this line should
actually be

    if (len >= 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list