From: root Date: Wed, 9 Aug 2006 22:01:07 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=b02b538f98d92fa69c390b9316168e723bb21297;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/Changes b/Changes index e8b3afa1..f055aec2 100644 --- a/Changes +++ b/Changes @@ -21,7 +21,9 @@ WISH: http://www120.pair.com/mccarthy/nextstep/intro.htmld/Workspace.html is the WISH: kick out xpm.C, replace by pixbuf DUMB: support tex fonts -TODO: fix crash because strwidth returning -1 in selection-popup +TODO: fix crash because strwidth returning -1 in selection-popup in LC_ALL=C + - give proper diagnostic when RXVT_SOCKET is too long instead of + corrupting the stack (patch by exg). 7.9 Mon Aug 7 18:16:07 CEST 2006 - fix the crashing bug people encountered with 7.8 + urxvtd + perl diff --git a/src/rxvtc.C b/src/rxvtc.C index 951f0537..f424f313 100644 --- a/src/rxvtc.C +++ b/src/rxvtc.C @@ -1,4 +1,4 @@ -/*--------------------------------*-C-*---------------------------------* +/*----------------------------------------------------------------------* * File: rxvtc.C *----------------------------------------------------------------------* * @@ -45,14 +45,21 @@ struct client : rxvt_connection { client::client () { + sockaddr_un sa; + char *sockname = rxvt_connection::unix_sockname (); + + if (strlen(sockname) >= sizeof(sa.sun_path)) + { + fputs ("socket name too long, aborting.\n", stderr); + exit (STATUS_FAILURE); + } + if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) { perror ("unable to create communications socket"); exit (STATUS_FAILURE); } - char *sockname = rxvt_connection::unix_sockname (); - sockaddr_un sa; sa.sun_family = AF_UNIX; strcpy (sa.sun_path, sockname); free (sockname); diff --git a/src/rxvtd.C b/src/rxvtd.C index 98a6e83a..f4b39a5a 100644 --- a/src/rxvtd.C +++ b/src/rxvtd.C @@ -1,4 +1,4 @@ -/*--------------------------------*-C-*---------------------------------* +/*----------------------------------------------------------------------* * File: rxvtd.C *----------------------------------------------------------------------* * @@ -71,6 +71,11 @@ struct unix_listener { unix_listener::unix_listener (const char *sockname) : accept_ev (this, &unix_listener::accept_cb) { + sockaddr_un sa; + + if (strlen(sockname) >= sizeof(sa.sun_path)) + rxvt_fatal ("socket name too long, aborting.\n"); + if ((fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) { perror ("unable to create listening socket"); @@ -79,8 +84,6 @@ unix_listener::unix_listener (const char *sockname) fcntl (fd, F_SETFD, FD_CLOEXEC); - sockaddr_un sa; - sa.sun_family = AF_UNIX; strcpy (sa.sun_path, sockname);