ls: avoid just-introduced buffer overrun
authorJim Meyering <meyering@redhat.com>
Thu, 10 Jun 2010 15:49:30 +0000 (17:49 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 10 Jun 2010 15:53:46 +0000 (17:53 +0200)
* src/ls.c (gobble_file): Revert part of my preceding change,
to avoid clobbering stack.

src/ls.c

index 4e0a036..668507e 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -2986,7 +2986,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode,
 
       if (format == long_format)
         {
-          char b[INT_BUFSIZE_BOUND (f->stat.st_nlink)];
+          char b[INT_BUFSIZE_BOUND (uintmax_t)];
           int b_len = strlen (umaxtostr (f->stat.st_nlink, b));
           if (nlink_width < b_len)
             nlink_width = b_len;