Bug 10992

Summary: xlogin crashes if window size is too small
Product: xorg Reporter: Mads N Noe <mntnoe>
Component: App/xdmAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: 7.1 (2006.05)   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Mads N Noe 2007-05-18 03:13:59 UTC
Steps to reproduce:
With default values in /etc/X11/xdm/Xresources, add the following, and start xdm.

xlogin*width: 290
xlogin*height: 140

Results:
xdm starts, but exits immediately while drawing xlogin.
Comment 1 Alan Coopersmith 2007-06-15 18:38:20 UTC
Stack trace in debugger shows we're trying to find the length of a string 
with negative length - oops!

(dbx) where
current thread: t@1
  [1] XftTextExtents8(0x808c3a8, 0x8150138, 0x8095a78, 0xffffffff, 0x8042f80, 0x0), at 0xfe8d26e7 
=>[2] XmuXftTextWidth(dpy = 0x808c3a8, font = 0x8150138, string = 0x8095a78 "", len = -1), line 1660 in "Login.c"
  [3] realizeValue(w = 0x80959c0, cursor = 0, promptNum = 0, gc = 0x814c0a8), line 411 in "Login.c"
  [4] DrawValue(w = 0x80959c0, cursor = 0, promptNum = 0), line 437 in "Login.c"
  [5] draw_it(w = 0x80959c0), line 806 in "Login.c"
[...]

Moving the (textlen > 0) from the end of the loop to the beginning makes it not
crash for me - committed that to git master in commit f8585c60831a8e5ddebce18bdd7e78d217a822c5.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.