[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

coreutils 6.5's ls crashes on unknown groups

From: Adam Sampson
Subject: coreutils 6.5's ls crashes on unknown groups
Date: Mon, 20 Nov 2006 01:24:40 +0000
User-agent: Mutt/1.5.11


Several of the changes to idcache.c between coreutils 6.4 and 6.5 are
broken -- they call strlen on a value that might be NULL. For example,
the group lookup code does this:

  grent = getgrgid (gid);
  name = grent ? grent->gr_name : NULL;
  tail = xmalloc (offsetof (struct userid, name) + strlen (name) + 1);

If the group being looked up doesn't exist, then that'll result in
strlen (NULL) being called. Hence:

$ /opt/packages/coreutils-6.4/bin/ls -ld work/elinks-0.11.2/config.h
-rw-r--r-- 1 20007 1001 20893 2006-11-19 13:47 work/elinks-0.11.2/config.h
$ /opt/packages/coreutils-6.5/bin/ls -ld work/elinks-0.11.2/config.h
Segmentation fault

This is on a Linux machine with glibc 2.3.6 -- but I wouldn't expect
strlen (NULL) to work on any machine. ;)


Adam Sampson <address@hidden>                         <http://offog.org/>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]