unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* 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

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

Po Lu <luangruo@yahoo.com> writes:

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

Thanks; pushed to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-09  4:04 UTC | newest]

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

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).