[file-roller] wrong use of gdk_property_get



commit 2d24790d89510ea2e7e5a824ab8a38f77eb08cda
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 15 09:44:04 2009 +0100

    wrong use of gdk_property_get
    
    fr-window.c:get_xds_atom_value may return uninitialized memory
    if gdk_property_get fails.
    
    [bug #604535]

 src/fr-window.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/fr-window.c b/src/fr-window.c
index dad2dea..7d7d791 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -4166,13 +4166,14 @@ get_xds_atom_value (GdkDragContext *context)
 	g_return_val_if_fail (context != NULL, NULL);
 	g_return_val_if_fail (context->source_window != NULL, NULL);
 
-	gdk_property_get (context->source_window,
-			  XDS_ATOM, TEXT_ATOM,
-			  0, MAX_XDS_ATOM_VAL_LEN,
-			  FALSE, NULL, NULL, NULL,
-			  (unsigned char **) &ret);
-
-	return ret;
+	if (gdk_property_get (context->source_window,
+			      XDS_ATOM, TEXT_ATOM,
+			      0, MAX_XDS_ATOM_VAL_LEN,
+			      FALSE, NULL, NULL, NULL,
+			      (unsigned char **) &ret))
+		return ret;
+
+	return NULL;
 }
 
 



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