summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--src/ustar.c10
-rw-r--r--src/ustar.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index f600715..38c62c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,7 +45,7 @@ AC_CHECK_FUNCS(
[\
fclose feof ferror fopen fprintf fputs fread free fwrite \
localtime malloc memcmp memcpy memset printf puts snprintf \
- sprintf strcmp strftime strlen strncpy strtol
+ sprintf strcmp strcpy strftime strlen strncpy strtol
],
[],
[funcs_missing=true])
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;