On 01/07/2011 06:09 PM, [email protected] 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   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to