From: Tim Kientzle Date: Thu, 2 Apr 2009 00:36:05 +0000 (-0400) Subject: Minor adjustment to uname/gname lookup: Bump the buffer X-Git-Tag: v2.7.0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88504f8144fdf5df6bd7a7ca9f806c8bd24a1b2b;p=thirdparty%2Flibarchive.git Minor adjustment to uname/gname lookup: Bump the buffer size to 128 bytes. The buffer should be allocated dynamically here. SVN-Revision: 907 --- diff --git a/libarchive/archive_read_disk_set_standard_lookup.c b/libarchive/archive_read_disk_set_standard_lookup.c index 10e718493..5996bfd16 100644 --- a/libarchive/archive_read_disk_set_standard_lookup.c +++ b/libarchive/archive_read_disk_set_standard_lookup.c @@ -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__) */