New version of w3m 0.5.2 Crashes - GDB help needed (SOLVED)

Eric Blake eblake@redhat.com
Sat Jan 8 02:14:00 GMT 2011


On 01/07/2011 06:09 PM, nyc4bos@aol.com wrote:
> It appears that it crashes if LANG is not defined
> 
> When function term.c:check_cygwin_console:239 is called and
> the following is evaluated with environment variable LANG undefined:
> 
> 	if (strncmp(getenv("LANG"), "ja", 2) == 0) {

Yep, getenv() is allowed to return NULL for unset vars, and
strncmp(NULL) is undefined behavior (typically a crash).  The fix is to
correct the code to check that getenv() returned something before
blindly handing it to strncmp.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110108/8b467eb0/attachment.sig>


More information about the Cygwin mailing list