[libsoup] soup_form_decode_multipart: allow file_control_name to be NULL as documented



commit 37e4290c0c634f464f4f2dcb1ba1a7e5d1d8f42c
Author: Simon McVittie <simon mcvittie collabora co uk>
Date:   Wed Feb 8 10:03:42 2012 +0000

    soup_form_decode_multipart: allow file_control_name to be NULL as documented
    
    This was documented as allowed, but would have crashed.
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479
    Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
    Reviewed-by: Dan Winship <danw gnome org>

 libsoup/soup-form.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libsoup/soup-form.c b/libsoup/soup-form.c
index a723430..4691c57 100644
--- a/libsoup/soup-form.c
+++ b/libsoup/soup-form.c
@@ -115,7 +115,7 @@ soup_form_decode (const char *encoded_form)
 /**
  * soup_form_decode_multipart:
  * @msg: a #SoupMessage containing a "multipart/form-data" request body
- * @file_control_name: the name of the HTML file upload control, or %NULL
+ * @file_control_name: (allow-none): the name of the HTML file upload control, or %NULL
  * @filename: (out) (allow-none): return location for the name of the uploaded file, or %NULL
  * @content_type: (out) (allow-none): return location for the MIME type of the uploaded file, or %NULL
  * @file: (out) (allow-none): return location for the uploaded file data, or %NULL
@@ -186,7 +186,7 @@ soup_form_decode_multipart (SoupMessage *msg, const char *file_control_name,
 			continue;
 		}
 
-		if (!strcmp (name, file_control_name)) {
+		if (file_control_name && !strcmp (name, file_control_name)) {
 			if (filename)
 				*filename = g_strdup (g_hash_table_lookup (params, "filename"));
 			if (content_type)



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