OSDN Git Service

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)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 14 Jul 2012 20:33:18 +0000 (16:33 -0400)
commitc1aac005d208d1a3225b8011169c857916006a6f
tree1666521fc435c737660f9013c4e16d12855bfba9
parent7f3295b3b3c8b00ff7ec007fe139da318cf043ab
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