--- GdkPixbuf.xs 10 Jan 2008 09:51:50 +1100 1.45 +++ GdkPixbuf.xs 14 Jan 2008 19:30:17 +1100 @@ -512,9 +512,13 @@ char ** lines; int i; CODE: - lines = g_new (char *, items - 1); + /* Add a NULL terminator to protect against a segv if too few lines + are supplied. GdkPixbuf io-xpm.c mem_buffer() recognises that as + an end of data. */ + lines = g_new (char *, items); for (i = 1; i < items; i++) lines[i-1] = SvPV_nolen (ST (i)); + lines[i-1] = NULL; RETVAL = gdk_pixbuf_new_from_xpm_data((const char**)lines); g_free(lines); OUTPUT: