[libsoup] soup-headers: fix possible null dereference



commit cf21cfa00bc18657f71a76e978ad9867ee64fe6c
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Dec 3 22:05:02 2016 +0100

    soup-headers: fix possible null dereference
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775579

 libsoup/soup-headers.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/soup-headers.c b/libsoup/soup-headers.c
index 9ad0a21..1c8900e 100644
--- a/libsoup/soup-headers.c
+++ b/libsoup/soup-headers.c
@@ -630,11 +630,13 @@ gboolean
 soup_header_contains (const char *header, const char *token)
 {
        const char *end;
-       guint len = strlen (token);
+       guint len;
 
        g_return_val_if_fail (header != NULL, FALSE);
        g_return_val_if_fail (token != NULL, FALSE);
 
+       len = strlen (token);
+
        header = skip_delims (header, ',');
        while (*header) {
                end = skip_item (header, ',');


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]