[libsoup] form: Check file pointer before dereferencing



commit fddede281641ad6fb7cb03bde1239f038c98034b
Author: Robert Swain <robert swain collabora co uk>
Date:   Tue Jan 31 14:27:38 2012 +0100

    form: Check file pointer before dereferencing
    
    [It's not documented as being allowed to be NULL, but later in the
    function there's a check, and GLib convention is generally that all
    'out' parameters are allowed to be NULL whether it makes sense or not. -smcv]
    
    Reviewed-by: Simon McVittie <simon mcvittie collabora co uk>
    Reviewed-by: Dan Winship <danw gnome org>
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479
    Bug-NB: NB#297634

 libsoup/soup-form.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/soup-form.c b/libsoup/soup-form.c
index 9e52793..6db1dd9 100644
--- a/libsoup/soup-form.c
+++ b/libsoup/soup-form.c
@@ -168,7 +168,8 @@ soup_form_decode_multipart (SoupMessage *msg, const char *file_control_name,
 		*filename = NULL;
 	if (content_type)
 		*content_type = NULL;
-	*file = NULL;
+	if (file)
+		*file = NULL;
 
 	form_data_set = g_hash_table_new_full (g_str_hash, g_str_equal,
 					       g_free, g_free);



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