unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* dbusbind.c patch, fixes possible segfault
@ 2008-04-13 14:28 David Hansen
  2008-04-13 16:43 ` Michael Albinus
  0 siblings, 1 reply; 11+ messages in thread
From: David Hansen @ 2008-04-13 14:28 UTC (permalink / raw)
  To: emacs-devel

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


This one is similar to the previous dbusbind.c patch.  No need to copy
the string and if dbus_bus_get_unique_name () returns NULL strcpy will
segfault.

David

2008-04-13  David Hansen  <david.hansen@gmx.net>

	* dbusbind.c (dbus-get-unique-name): Remove extra copying of name
	string.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 949 bytes --]

*** dbusbind.c.~1.24.~	2008-04-05 23:46:55.000000000 +0200
--- dbusbind.c	2008-04-13 15:19:27.000000000 +0200
***************
*** 701,707 ****
       Lisp_Object bus;
  {
    DBusConnection *connection;
!   char name[DBUS_MAXIMUM_NAME_LENGTH];
  
    /* Check parameters.  */
    CHECK_SYMBOL (bus);
--- 701,707 ----
       Lisp_Object bus;
  {
    DBusConnection *connection;
!   const char *name;
  
    /* Check parameters.  */
    CHECK_SYMBOL (bus);
***************
*** 710,716 ****
    connection = xd_initialize (bus);
  
    /* Request the name.  */
!   strcpy (name, dbus_bus_get_unique_name (connection));
    if (name == NULL)
      xsignal1 (Qdbus_error, build_string ("No unique name available"));
  
--- 710,716 ----
    connection = xd_initialize (bus);
  
    /* Request the name.  */
!   name = dbus_bus_get_unique_name (connection);
    if (name == NULL)
      xsignal1 (Qdbus_error, build_string ("No unique name available"));
  

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

end of thread, other threads:[~2008-04-15  7:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-13 14:28 dbusbind.c patch, fixes possible segfault David Hansen
2008-04-13 16:43 ` Michael Albinus
2008-04-13 16:58   ` David Hansen
2008-04-14  4:04   ` David Hansen
2008-04-14 17:36     ` Eli Zaretskii
2008-04-14 18:47     ` Michael Albinus
2008-04-14 18:59       ` David Hansen
2008-04-15  2:04         ` Glenn Morris
2008-04-15  2:39           ` Stefan Monnier
2008-04-15  7:10             ` Glenn Morris
2008-04-14 20:12       ` Stefan Monnier

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