This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]