diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ustar.c | 10 | ||||
-rw-r--r-- | src/ustar.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/ustar.c b/src/ustar.c index 749af02..c759781 100644 --- a/src/ustar.c +++ b/src/ustar.c @@ -201,7 +201,9 @@ opkg_opk_ustar_list(struct opkg_opk_ustar *ustar, case '2': /* Symbolic link */ (*member)->type = 'l'; strncpy((*member)->linkname, ustar->header.linkname, - sizeof((*member)->linkname)); + sizeof(ustar->header.linkname)); + (*member)->linkname[sizeof((*member)->linkname) - 1] = + '\0'; break; case '3': /* Character special file */ (*member)->type = 'c'; @@ -220,10 +222,8 @@ opkg_opk_ustar_list(struct opkg_opk_ustar *ustar, free(*member); return OPKG_OPK_ERROR; /* Unsupported */ } - strncpy((*member)->uname, ustar->header.uname, - sizeof((*member)->uname)); - strncpy((*member)->gname, ustar->header.gname, - sizeof((*member)->gname)); + strcpy((*member)->uname, ustar->header.uname); + strcpy((*member)->gname, ustar->header.gname); /* Seek through data records until next header record. */ while (ustar->data_size_remaining > 0) { diff --git a/src/ustar.h b/src/ustar.h index 3495d38..220603a 100644 --- a/src/ustar.h +++ b/src/ustar.h @@ -35,7 +35,7 @@ struct opkg_opk_ustar_member { uint64_t size; int64_t mtime; char type; - char linkname[100]; + char linkname[101]; char uname [32]; char gname [32]; struct opkg_opk_ustar_member *next; |