all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: 'Chong Yidong' <cyd@gnu.org>, 11141@debbugs.gnu.org
Subject: bug#11141: 24.0.94; crash with `x-popup-dialog'
Date: Sun, 01 Apr 2012 09:16:57 +0200	[thread overview]
Message-ID: <m2zkav3ora.fsf@linux-m68k.org> (raw)
In-Reply-To: <BA54E3DC9C1F4BD1B5C21B147685DFA2@us.oracle.com> (Drew Adams's message of "Sat, 31 Mar 2012 23:31:49 -0700")

Please try this.

Andreas.

	* w32menu.c (is_simple_dialog): Properly check lisp types.

diff --git a/src/w32menu.c b/src/w32menu.c
index b5cc680..b25edf0 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;
 

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





  parent reply	other threads:[~2012-04-01  7:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-31 21:23 bug#11141: 24.0.94; crash with `x-popup-dialog' Drew Adams
2012-04-01  6:17 ` Chong Yidong
2012-04-01  6:31   ` Drew Adams
2012-04-01  6:34     ` Drew Adams
2012-04-01  7:16     ` Andreas Schwab [this message]
2012-04-01 16:34       ` Eli Zaretskii
2012-04-01 16:46         ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2zkav3ora.fsf@linux-m68k.org \
    --to=schwab@linux-m68k.org \
    --cc=11141@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    --cc=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.