[file-roller/gnome-2-28] wrong use of gdk_property_get



commit 6c97679dadb6a0410040106f852172f824004553
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Dec 15 09:47:34 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 1e052f8..a350d41 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -4141,13 +4141,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]