diff options
author | Patrick Griffis <pgriffis@igalia.com> | 2020-12-16 15:54:32 -0600 |
---|---|---|
committer | Patrick Griffis <pgriffis@igalia.com> | 2020-12-16 15:54:32 -0600 |
commit | b0fd7e1f65049b7efdf50febe6765039de4289ed (patch) | |
tree | 8b05cf3166c82d65aed81981c8ed157a9e8875c3 | |
parent | 19f85ec171d1d37e04135284ecef8e7155a89d02 (diff) | |
download | libsoup-b0fd7e1f65049b7efdf50febe6765039de4289ed.tar.gz |
Handle sniffing bytes with 0 size
-rw-r--r-- | libsoup/content-sniffer/soup-content-sniffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libsoup/content-sniffer/soup-content-sniffer.c b/libsoup/content-sniffer/soup-content-sniffer.c index cb4255ad..cf5da7e1 100644 --- a/libsoup/content-sniffer/soup-content-sniffer.c +++ b/libsoup/content-sniffer/soup-content-sniffer.c @@ -507,6 +507,9 @@ sniff_unknown (SoupContentSniffer *sniffer, GBytes *buffer, resource_length = MIN (512, resource_length); guint i; + if (resource_length == 0) + return g_strdup ("application/octet-stream"); + for (i = 0; i < G_N_ELEMENTS (types_table); i++) { SoupContentSnifferPattern *type_row = &(types_table[i]); |