Bug 161298 - x11/rxvt-unicode: fix segfault on 9.0-BETA3
Summary: x11/rxvt-unicode: fix segfault on 9.0-BETA3
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Thierry Thomas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-05 11:30 UTC by Guido Falsi
Modified: 2011-10-05 21:09 UTC (History)
0 users

See Also:


Attachments
file.diff (1.19 KB, patch)
2011-10-05 11:30 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Falsi freebsd_committer freebsd_triage 2011-10-05 11:30:06 UTC
After upgrading to 9.0-BETA3 and upgrading rxvt-unicode to last
version the urxvtd program started segfaulting when trying to open
a terminal.

After some debugging I nailed it down to a 0 pointer being passed
to strncpy() in libptytty/src/logging.C.

A new patch in the last update to the port happens to call fill_utmpx()
in that file with an argument(a pointer) set to 0 for certain
conditions(on 9.0, for example). There is no check in the function
for NULL or 0 pointers though, so strncpy() gets passed a 0 pointer,
resulting in a segmentation fault.

My fix simply adds a conditional check and skips the strncpy() when
the id argument is set to zero.

How-To-Repeat: 
On a recent 9.0 system:

Install x11/rxvt-unicode

Launch "urxvtd -o" in a terminal window.(due to the bug I've been
using xterm)

From another terminal window try opening a rxvt-unicode terminal
by using the daemon, with "urxvtc".

the terminal should not open and the daemon exit on signal 11.

If gdb is used on urxvtd the stack will show it segfaults in strncpy()
called from fill_utmpx().
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-10-05 11:30:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->thierry

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2011-10-05 20:37:26 UTC
thierry     2011-10-05 19:37:11 UTC

  FreeBSD ports repository

  Modified files:
    x11/rxvt-unicode     Makefile 
    x11/rxvt-unicode/files patch-libptytty-src-logging.C 
  Log:
  - Fix the bug reported with the latest version;
  
  - bump PORTREVISION.
  
  PR:             ports/161298
  Submitted by:   Guido Falsi <mad (at) madpilot.net>
  
  Revision  Changes    Path
  1.138     +1 -0      ports/x11/rxvt-unicode/Makefile
  1.2       +14 -4     ports/x11/rxvt-unicode/files/patch-libptytty-src-logging.C
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Thierry Thomas freebsd_committer freebsd_triage 2011-10-05 20:37:37 UTC
State Changed
From-To: open->closed


Committed, thanks!