gio/tests/contenttype: Call g_content_type_guess() with valid data len
authorMartin Pitt <martinpitt@gnome.org>
Wed, 27 Jun 2012 07:25:37 +0000 (09:25 +0200)
committerMartin Pitt <martinpitt@gnome.org>
Wed, 27 Jun 2012 14:00:27 +0000 (16:00 +0200)
commit139c1ce9884a91be167ab9d48d3c4b0df89dd112
tree182d72b1d88e1bc5f20b2b4167406ab9f49fd9a4
parent95f29687e14423ca541cac1c00137375b935168d
gio/tests/contenttype: Call g_content_type_guess() with valid data len

g_content_type_guess() requires specifying a valid data length. Fixes a
segfault when running the test.

Also add an explicit check for this and return XDG_MIME_TYPE_UNKNOWN when
data_size is specified as -1, to avoid crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=674452
gio/gcontenttype.c
gio/tests/contenttype.c