* bug#51682: 29.0.50; [PATCH] Raise an error if creating an unknown xwidget type
[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
2021-11-09 4:04 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-08 7:07 UTC (permalink / raw)
To: 51682
[-- 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
^ permalink raw reply related [flat|nested] 2+ messages in thread