[libsoup] Handle sniffing bytes with 0 size
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] Handle sniffing bytes with 0 size
- Date: Wed, 16 Dec 2020 21:55:21 +0000 (UTC)
commit b0fd7e1f65049b7efdf50febe6765039de4289ed
Author: Patrick Griffis <pgriffis igalia com>
Date: Wed Dec 16 15:54:32 2020 -0600
Handle sniffing bytes with 0 size
libsoup/content-sniffer/soup-content-sniffer.c | 3 +++
1 file changed, 3 insertions(+)
---
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]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]