Subject: Re: 26.1.90; D-Bus crashes Emacs: consp, Fatal error 7: Bus error

From: Paul Eggert <[email-masked]>
Date: Tue, 27 Nov 2018 21:40:55 -0800

Thanks for reporting that. I installed the attached into the master branch and 
am marking the bug as fixed. Not sure whether it's worth installing into the 
emacs-26 branch. It is a serious problem if Lisp code can make Emacs crash; on 
the other hand, the usage is erroneous.
>From cef3f8fbf98296eaa59f80716db33b4f8689889a Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Tue, 27 Nov 2018 21:36:18 -0800
Subject: [PATCH] Fix core dump in dbus-message-internal
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* src/dbusbind.c (Fdbus_message_internal):
Don’t go past array end (Bug#33530).
---
 src/dbusbind.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dbusbind.c b/src/dbusbind.c
index 9bc344e961..403fc598c0 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -1423,7 +1423,7 @@ usage: (dbus-message-internal &rest REST)  */)
   for (; count < nargs; ++count)
     {
       dtype = XD_OBJECT_TO_DBUS_TYPE (args[count]);
-      if (XD_DBUS_TYPE_P (args[count]))
+      if (count + 1 < nargs && XD_DBUS_TYPE_P (args[count]))
 	{
 	  XD_DEBUG_VALID_LISP_OBJECT_P (args[count]);
 	  XD_DEBUG_VALID_LISP_OBJECT_P (args[count+1]);
-- 
2.17.1