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

gEDA-cvs: CVS update: x_dialog.c



  User: pcjc2   
  Date: 07/04/21 16:33:53

  Modified:    .        x_dialog.c
  Log:
  Check return value of gdk_keyval_name() is non NULL before
  
  attempting to match against it. Fixes bug #1692634.
  
  
  
  
  Revision  Changes    Path
  1.26      +25 -5     eda/geda/gaf/gattrib/src/x_dialog.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_dialog.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gattrib/src/x_dialog.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -b -r1.25 -r1.26
  --- x_dialog.c	19 Oct 2006 22:37:36 -0000	1.25
  +++ x_dialog.c	21 Apr 2007 20:33:52 -0000	1.26
  @@ -1,4 +1,4 @@
  -/* $Id: x_dialog.c,v 1.25 2006/10/19 22:37:36 danmc Exp $ */
  +/* $Id: x_dialog.c,v 1.26 2007/04/21 20:33:52 pcjc2 Exp $ */
   
   /* gEDA - GPL Electronic Design Automation
    * gattrib -- gEDA component and net attribute manipulation using spreadsheet.
  @@ -155,7 +155,12 @@
   int x_dialog_newattrib_keypress_callback(GtkWidget * widget, GdkEventKey * event,
   			    GtkWidget *window)
   {
  -  if (strcmp(gdk_keyval_name(event->keyval), "Escape") == 0) {
  +  char *key_name;
  +
  +  key_name = gdk_keyval_name(event->keyval);
  +  if ( key_name == NULL ) return FALSE;
  +
  +  if (strcmp(key_name, "Escape") == 0) {
   #ifdef DEBUG
       printf("In x_dialog_newattrib_keypress, trying to close window.\n");
   #endif
  @@ -311,7 +316,12 @@
   					 GdkEventKey * event,
   					 GtkWidget *window)
   {
  -  if (strcmp(gdk_keyval_name(event->keyval), "Escape") == 0) {
  +  char *key_name;
  +
  +  key_name = gdk_keyval_name(event->keyval);
  +  if ( key_name == NULL ) return FALSE;
  +
  +  if (strcmp(key_name, "Escape") == 0) {
   #ifdef DEBUG
       printf("In x_dialog_delattrib_keypress, trying to close window.\n");
   #endif
  @@ -784,7 +794,12 @@
   int x_dialog_about_keypress_callback(GtkWidget * widget, GdkEventKey * event,
   			    GtkWidget *window)
   {
  -  if (strcmp(gdk_keyval_name(event->keyval), "Escape") == 0) {
  +  char *key_name;
  +
  +  key_name = gdk_keyval_name(event->keyval);
  +  if ( key_name == NULL ) return FALSE;
  +
  +  if (strcmp(key_name, "Escape") == 0) {
   #ifdef DEBUG
       printf("In x_dialog_about_keypress_callback, trying to close window.\n");
   #endif
  @@ -984,7 +999,12 @@
   					       GdkEventKey * event,
   					       GtkWidget *window)
   {
  -  if (strcmp(gdk_keyval_name(event->keyval), "Escape") == 0) {
  +  char *key_name;
  +
  +  key_name = gdk_keyval_name(event->keyval);
  +  if ( key_name == NULL ) return FALSE;
  +
  +  if (strcmp(key_name, "Escape") == 0) {
   #ifdef DEBUG
       printf("In x_dialog_export_file_keypress, trying to close window.\n");
   #endif
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs