summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-10-03 23:23:16 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-10-03 23:23:16 +0000
commit92fa22314615a62dc09ac6dbd64308f6ad2ec149 (patch)
treeed2242076e6f1aeb03091a91cec7a147ab473e8d
parent12359a817b7b24a4a99095e46427ad6284a8149f (diff)
downloadgtk+-92fa22314615a62dc09ac6dbd64308f6ad2ec149.tar.gz
Fix error in computing length and a memory leak. (Fixes #94072, reported
Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkselection-x11.c (gdk_selection_property_get): Fix error in computing length and a memory leak. (Fixes #94072, reported by Hema Seetharamaiah) * gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event used instead of event.
-rw-r--r--ChangeLog9
-rw-r--r--ChangeLog.pre-2-109
-rw-r--r--ChangeLog.pre-2-29
-rw-r--r--ChangeLog.pre-2-49
-rw-r--r--ChangeLog.pre-2-69
-rw-r--r--ChangeLog.pre-2-89
-rw-r--r--gdk/x11/gdkselection-x11.c55
-rw-r--r--gtk/gtkmenu.c3
-rw-r--r--tests/testtext.c4
9 files changed, 95 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index eb7b32615c..f375952c50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
+ Fix error in computing length and a memory leak.
+ (Fixes #94072, reported by Hema Seetharamaiah)
+
+ * gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
+ used instead of event.
+
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index eb7b32615c..f375952c50 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,12 @@
+Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
+ Fix error in computing length and a memory leak.
+ (Fixes #94072, reported by Hema Seetharamaiah)
+
+ * gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
+ used instead of event.
+
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index eb7b32615c..f375952c50 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,12 @@
+Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
+ Fix error in computing length and a memory leak.
+ (Fixes #94072, reported by Hema Seetharamaiah)
+
+ * gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
+ used instead of event.
+
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index eb7b32615c..f375952c50 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,12 @@
+Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
+ Fix error in computing length and a memory leak.
+ (Fixes #94072, reported by Hema Seetharamaiah)
+
+ * gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
+ used instead of event.
+
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index eb7b32615c..f375952c50 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,12 @@
+Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
+ Fix error in computing length and a memory leak.
+ (Fixes #94072, reported by Hema Seetharamaiah)
+
+ * gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
+ used instead of event.
+
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index eb7b32615c..f375952c50 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,12 @@
+Thu Oct 3 19:00:55 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
+ Fix error in computing length and a memory leak.
+ (Fixes #94072, reported by Hema Seetharamaiah)
+
+ * gtk/gtkmenu.c (gtk_menu_motion_notify): Fix &event
+ used instead of event.
+
2002-10-04 Matthias Clasen <maclas@gmx.de>
* demos/gtk-demo/main.c (main):
diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c
index 6c66d77a88..d79f2cd5a8 100644
--- a/gdk/x11/gdkselection-x11.c
+++ b/gdk/x11/gdkselection-x11.c
@@ -295,35 +295,54 @@ gdk_selection_property_get (GdkWindow *requestor,
*ret_type = gdk_x11_xatom_to_atom_for_display (display, prop_type);
if (ret_format)
*ret_format = prop_format;
-
- /* Add on an extra byte to handle null termination. X guarantees
- that t will be 1 longer than nitems and null terminated */
- length = nitems + 1;
- if (data)
+ if (prop_type == XA_ATOM ||
+ prop_type == gdk_x11_get_xatom_by_name_for_display (display, "ATOM_PAIR"))
{
- *data = g_new (guchar, length);
-
- if (prop_type == XA_ATOM ||
- prop_type == gdk_x11_get_xatom_by_name_for_display (display, "ATOM_PAIR"))
+ Atom* atoms = (Atom*) t;
+ GdkAtom* atoms_dest;
+ gint num_atom, i;
+
+ if (prop_format != 32)
+ goto err;
+
+ num_atom = nitems;
+ length = sizeof (GdkAtom) * num_atom + 1;
+
+ if (data)
{
- Atom* atoms = (Atom*) t;
- GdkAtom* atoms_dest;
- gint num_atom, i;
-
- num_atom = (length - 1) / sizeof (Atom);
- length = sizeof (GdkAtom) * num_atom + 1;
*data = g_malloc (length);
(*data)[length - 1] = '\0';
atoms_dest = (GdkAtom *)(*data);
-
+
for (i=0; i < num_atom; i++)
atoms_dest[i] = gdk_x11_xatom_to_atom_for_display (display, atoms[i]);
}
- else
+ }
+ else
+ {
+ switch (prop_format)
{
- *data = g_memdup (t, length);
+ case 8:
+ length = nitems;
+ break;
+ case 16:
+ length = sizeof(short) * nitems;
+ break;
+ case 32:
+ length = sizeof(long) * nitems;
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
}
+
+ /* Add on an extra byte to handle null termination. X guarantees
+ that t will be 1 longer than nitems and null terminated */
+ length += 1;
+
+ if (data)
+ *data = g_memdup (t, length);
}
if (t)
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 5b3efc51fd..c643669d27 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1982,7 +1982,6 @@ gtk_menu_motion_notify (GtkWidget *widget,
GdkEvent *send_event = gdk_event_new (GDK_ENTER_NOTIFY);
gboolean result;
- send_event->crossing.type = GDK_ENTER_NOTIFY;
send_event->crossing.window = g_object_ref (event->window);
send_event->crossing.time = event->time;
send_event->crossing.send_event = TRUE;
@@ -1997,7 +1996,7 @@ gtk_menu_motion_notify (GtkWidget *widget,
* menuitem is a child of the active menu or some parent
* menu of the active menu.
*/
- result = gtk_widget_event (widget, &send_event);
+ result = gtk_widget_event (widget, send_event);
gdk_event_free (send_event);
return result;
diff --git a/tests/testtext.c b/tests/testtext.c
index 1b222d0514..2097f3b46e 100644
--- a/tests/testtext.c
+++ b/tests/testtext.c
@@ -1715,9 +1715,11 @@ create_buffer (void)
++i;
}
-
+
+#if 0
buffer->invisible_tag = gtk_text_buffer_create_tag (buffer->buffer, NULL,
"invisible", TRUE, NULL);
+#endif
buffer->not_editable_tag =
gtk_text_buffer_create_tag (buffer->buffer, NULL,