diff options
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/database.c b/src/database.c index 8e58785..5bffb43 100644 --- a/src/database.c +++ b/src/database.c @@ -2787,7 +2787,10 @@ static int apk_db_unpack_pkg(struct apk_database *db, if (!(pkg->repos & db->local_repos)) need_copy = TRUE; } else { - strncpy(file, pkg->filename, sizeof(file)); + if (strlcpy(file, pkg->filename, sizeof file) >= sizeof file) { + r = -ENAMETOOLONG; + goto err_msg; + } need_copy = TRUE; } if (!apk_db_cache_active(db)) |