Subject: bug#11442: closed (Re: bug#11442: dbus uses Emacs integer as pointer, possible core dump)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 09 May 2012 21:39:01 +0000

Your bug report

#11442: dbus uses Emacs integer as pointer, possible core dump

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
11442: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11442
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#11442: dbus uses Emacs integer as pointer, possible core dump
From: Paul Eggert <[email-masked]>
To: Michael Albinus <[email-masked]>
Cc: Andreas Schwab <[email-masked]>, [email-masked]
Date: Wed, 09 May 2012 14:35:47 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

On 05/09/2012 02:19 PM, Michael Albinus wrote:
> I've converted it to be an internal Lisp object.

Thanks; that looks good.  Closing the bug.

Subject: dbus uses Emacs integer as pointer, possible core dump
From: Paul Eggert <[email-masked]>
To: [email-masked]
Cc: Michael Albinus <[email-masked]>
Date: Wed, 09 May 2012 08:20:57 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

The trunk version of Emacs src/dbusbind.c contains a function
xd_get_connection_address that does this:

     connection = (DBusConnection *) (intptr_t) XFASTINT (val);

This converts an Emacs integer to a pointer without checking
that it is actually of the proper C type.  It is possible
for Lisp code to mistakenly put an integer there that will
cause Emacs to dump core.  Shouldn't this be made safe, so
that Lisp code can't do that?  For example, a DbusConnection *
could be made a proper Lisp pseudovector or misc type or
something like that.  The idea is to avoid a bad pointer
leaking into the C code.