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
-/*--------------------------------*-C-*---------------------------------*
+/*----------------------------------------------------------------------*
* File: rxvtc.C
*----------------------------------------------------------------------*
*
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);
-/*--------------------------------*-C-*---------------------------------*
+/*----------------------------------------------------------------------*
* File: rxvtd.C
*----------------------------------------------------------------------*
*
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");
fcntl (fd, F_SETFD, FD_CLOEXEC);
- sockaddr_un sa;
-
sa.sun_family = AF_UNIX;
strcpy (sa.sun_path, sockname);