GNOME Bugzilla – Bug 657359
Crash when specifying data length in gtk_css_provider_load_from_data
Last modified: 2011-08-26 14:36:16 UTC
Created attachment 194727 [details] Test program gtk_css_provider_load_from_data allows to specify data length, but will crash if given anything that isn't null-capped: "Gtk:ERROR:/build/buildd/gtk+3.0-3.1.12/./gtk/gtkcssprovider.c:1275:gtk_css_scanner_new: assertion failed: (data[length] == 0)" A test program is attached. Compile with: gcc provider.c `pkg-config --libs --cflags gtk+-3.0`
Created attachment 194736 [details] [review] Proposed patch Here's a patch that g_strndup's incoming strings to ensure a null ending byte. It also removes the length argument from the function that asserted, removing the need for the assert.
Turns out my branch that fixes that wasn't pushed. Bad me. Pushed it now and added your testsuite inside the testsuite.