From 3b0512a3d5c5ef30308bc466d914c4282153d453 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 1 Apr 2012 18:42:57 +0200 Subject: [PATCH] Fixes: debbugs:11141 * w32menu.c (is_simple_dialog): Properly check lisp types. --- src/ChangeLog | 5 +++++ src/w32menu.c | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9be289c42bb..ee54c48cd94 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-04-01 Andreas Schwab + + * w32menu.c (is_simple_dialog): Properly check lisp types. + (Bug#11141) + 2012-03-31 Eli Zaretskii * xdisp.c (move_it_by_lines): When DVPOS is positive, and the diff --git a/src/w32menu.c b/src/w32menu.c index b5cc6801a72..b25edf0f269 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -1173,18 +1173,23 @@ w32_dialog_show (FRAME_PTR f, int keymaps, static int is_simple_dialog (Lisp_Object contents) { - Lisp_Object options = XCDR (contents); + Lisp_Object options; Lisp_Object name, yes, no, other; + if (!CONSP (contents)) + return 0; + options = XCDR (contents); + yes = build_string ("Yes"); no = build_string ("No"); if (!CONSP (options)) return 0; - name = XCAR (XCAR (options)); - if (!CONSP (options)) + name = XCAR (options); + if (!CONSP (name)) return 0; + name = XCAR (name); if (!NILP (Fstring_equal (name, yes))) other = no; @@ -1197,7 +1202,10 @@ is_simple_dialog (Lisp_Object contents) if (!CONSP (options)) return 0; - name = XCAR (XCAR (options)); + name = XCAR (options); + if (!CONSP (name)) + return 0; + name = XCAR (name); if (NILP (Fstring_equal (name, other))) return 0; -- 2.39.5