Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sushi Fix a segfault when the user hits ESC inside ...



details:   https://anonhg.NetBSD.org/src/rev/66c1c030288f
branches:  trunk
changeset: 501953:66c1c030288f
user:      garbled <garbled%NetBSD.org@localhost>
date:      Tue Jan 09 19:32:35 2001 +0000

description:
Fix a segfault when the user hits ESC inside the F4 selection box for a
list field.

diffstat:

 usr.sbin/sushi/scanform.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 6166630f3fc3 -r 66c1c030288f usr.sbin/sushi/scanform.c
--- a/usr.sbin/sushi/scanform.c Tue Jan 09 19:30:38 2001 +0000
+++ b/usr.sbin/sushi/scanform.c Tue Jan 09 19:32:35 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: scanform.c,v 1.2 2001/01/06 15:04:05 veego Exp $       */
+/*      $NetBSD: scanform.c,v 1.3 2001/01/09 19:32:35 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -438,6 +438,8 @@
                /* pull the grand popup list */
                curfield = current_field(form);
                list = (char **) field_userptr(curfield);
+               if (list == NULL)
+                       break;
                for (i=0, y=0; list[i] != NULL; i++)
                        if (strlen(list[i]) > y)
                                y = strlen(list[i]);
@@ -476,7 +478,8 @@
                            10, y+2, catgets(catalog, 4, 1, "Select choice"),
                            list, i, FALSE, A_REVERSE ,TRUE, FALSE);
                        i = activateCDKScroll(plist, NULL);
-                       set_field_buffer(curfield, 0, list[i]);
+                       if (i != -1)
+                               set_field_buffer(curfield, 0, list[i]);
                        destroyCDKScroll(plist);
                }
                return FALSE;



Home | Main Index | Thread Index | Old Index