unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 51682@debbugs.gnu.org
Subject: bug#51682: 29.0.50; [PATCH] Raise an error if creating an unknown xwidget type
Date: Mon, 08 Nov 2021 15:07:45 +0800	[thread overview]
Message-ID: <87y25znn0e.fsf@yahoo.com> (raw)
In-Reply-To: 87y25znn0e.fsf.ref@yahoo.com

[-- Attachment #1: Type: text/plain, Size: 118 bytes --]

Otherwise code can create bogus xwidgets for whom widget_osr and
widgetwindow_osr are NULL, which can cause crashes.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Raise-an-error-if-creating-an-unknown-xwidget-type.patch --]
[-- Type: text/x-patch, Size: 705 bytes --]

From c9155cfe0f1c8c0d51c81db01a0e942f6bed4345 Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@yahoo.com>
Date: Mon, 8 Nov 2021 15:06:10 +0800
Subject: [PATCH] Raise an error if creating an unknown xwidget type

* src/xwidget.c (Fmake_xwidget): Error if TYPE is invalid.
---
 src/xwidget.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/xwidget.c b/src/xwidget.c
index 2d9351308e..ec0c283c80 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -128,6 +128,9 @@ DEFUN ("make-xwidget",
   CHECK_FIXNAT (width);
   CHECK_FIXNAT (height);
 
+  if (!EQ (type, Qwebkit))
+    error ("Bad xwidget type");
+
   struct xwidget *xw = allocate_xwidget ();
   Lisp_Object val;
   xw->type = type;
-- 
2.31.1


       reply	other threads:[~2021-11-08  7:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87y25znn0e.fsf.ref@yahoo.com>
2021-11-08  7:07 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-11-09  4:04   ` bug#51682: 29.0.50; [PATCH] Raise an error if creating an unknown xwidget type Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87y25znn0e.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=51682@debbugs.gnu.org \
    --cc=luangruo@yahoo.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).