]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Minor adjustment to uname/gname lookup: Bump the buffer
authorTim Kientzle <kientzle@gmail.com>
Thu, 2 Apr 2009 00:36:05 +0000 (20:36 -0400)
committerTim Kientzle <kientzle@gmail.com>
Thu, 2 Apr 2009 00:36:05 +0000 (20:36 -0400)
size to 128 bytes.  The buffer should be allocated dynamically
here.

SVN-Revision: 907

libarchive/archive_read_disk_set_standard_lookup.c

index 10e7184934f6a4407b889f9f3b39382fe25039e9..5996bfd16e9adfb5d20ef89b6c5f8597be69bfcc 100644 (file)
@@ -182,7 +182,7 @@ lookup_uname(void *data, uid_t uid)
 static const char *
 lookup_uname_helper(struct archive *a, id_t id)
 {
-       char buffer[64];
+       char buffer[128];
        struct passwd   pwent, *result;
        int r;
 
@@ -196,7 +196,7 @@ lookup_uname_helper(struct archive *a, id_t id)
        if (result == NULL)
                return (NULL);
 
-       return strdup(pwent.pw_name);
+       return strdup(result->pw_name);
 }
 
 static const char *
@@ -210,7 +210,7 @@ lookup_gname(void *data, gid_t gid)
 static const char *
 lookup_gname_helper(struct archive *a, id_t id)
 {
-       char buffer[64];
+       char buffer[128];
        struct group    grent, *result;
        int r;
 
@@ -224,6 +224,6 @@ lookup_gname_helper(struct archive *a, id_t id)
        if (result == NULL)
                return (NULL);
 
-       return strdup(grent.gr_name);
+       return strdup(result->gr_name);
 }
 #endif /* ! (_WIN32 && !__CYGWIN__) */