User: james
Date: 06/06/29 18:59:02
Modified: xemacs/src ChangeLog scrollbar-gtk.c scrollbar-msw.c
Log:
Check scrollbar instance data for NULLness before dereferencing.
<m31wt77vcf.fsf(a)jerrypc.cs.usu.edu>
Revision Changes Path
1.981 +7 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.980
retrieving revision 1.981
diff -u -p -r1.980 -r1.981
--- ChangeLog 2006/06/27 22:59:37 1.980
+++ ChangeLog 2006/06/29 16:58:59 1.981
@@ -1,3 +1,10 @@
+2006-06-29 Jerry James <james(a)xemacs.org>
+
+ * scrollbar-gtk.c (gtk_free_scrollbar_instance): Compare
+ instance->scrollbar_data against NULL before using it.
+ * scrollbar-msw.c (mswindows_free_scrollbar_instance): Compare
+ sb->scrollbar_data against NULL before using it.
+
2006-06-22 Jerry James <james(a)xemacs.org>
* redisplay-gtk.c (gtk_output_display_block): Fix a Dynarr leak.
1.20 +8 -6 XEmacs/xemacs/src/scrollbar-gtk.c
Index: scrollbar-gtk.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/scrollbar-gtk.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -p -r1.19 -r1.20
--- scrollbar-gtk.c 2005/10/25 08:32:48 1.19
+++ scrollbar-gtk.c 2006/06/29 16:59:00 1.20
@@ -56,14 +56,16 @@ gtk_inhibit_scrollbar_slider_size_change
static void
gtk_free_scrollbar_instance (struct scrollbar_instance *instance)
{
- if (SCROLLBAR_GTK_WIDGET (instance))
+ if (instance->scrollbar_data)
{
- gtk_widget_hide_all (SCROLLBAR_GTK_WIDGET (instance));
- gtk_widget_destroy (SCROLLBAR_GTK_WIDGET (instance));
- }
+ if (SCROLLBAR_GTK_WIDGET (instance))
+ {
+ gtk_widget_hide_all (SCROLLBAR_GTK_WIDGET (instance));
+ gtk_widget_destroy (SCROLLBAR_GTK_WIDGET (instance));
+ }
- if (instance->scrollbar_data)
- xfree (instance->scrollbar_data, void *);
+ xfree (instance->scrollbar_data, void *);
+ }
}
/* A device method. */
1.32 +12 -10 XEmacs/xemacs/src/scrollbar-msw.c
Index: scrollbar-msw.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/scrollbar-msw.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -p -r1.31 -r1.32
--- scrollbar-msw.c 2005/10/25 08:32:49 1.31
+++ scrollbar-msw.c 2006/06/29 16:59:00 1.32
@@ -90,17 +90,19 @@ mswindows_create_scrollbar_instance (str
static void
mswindows_free_scrollbar_instance (struct scrollbar_instance *sb)
{
- void *opaque =
- (void *) qxeGetWindowLong (SCROLLBAR_MSW_HANDLE (sb), GWL_USERDATA);
- Lisp_Object ptr;
-
- ptr = VOID_TO_LISP (opaque);
- assert (OPAQUE_PTRP (ptr));
- ptr = Fremhash (ptr, Vmswindows_scrollbar_instance_table);
- assert (!NILP (ptr));
- DestroyWindow (SCROLLBAR_MSW_HANDLE (sb));
if (sb->scrollbar_data)
- xfree (sb->scrollbar_data, void *);
+ {
+ void *opaque =
+ (void *) qxeGetWindowLong (SCROLLBAR_MSW_HANDLE (sb), GWL_USERDATA);
+ Lisp_Object ptr;
+
+ ptr = VOID_TO_LISP (opaque);
+ assert (OPAQUE_PTRP (ptr));
+ ptr = Fremhash (ptr, Vmswindows_scrollbar_instance_table);
+ assert (!NILP (ptr));
+ DestroyWindow (SCROLLBAR_MSW_HANDLE (sb));
+ xfree (sb->scrollbar_data, void *);
+ }
}
static void
Show replies by date