summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/add.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-03-29 19:18:59 +0200
committerAurelien Foret <aurelien@archlinux.org>2005-03-29 19:18:59 +0200
commit6063424c82f18f3ea8bbf9a92fd30b349ec778bd (patch)
tree398d20c2637ddf5a44ddcfbeacb449c256e71c18 /lib/libalpm/add.c
parent3ac94cc71905535252db84f8a0c26a4f59d8162c (diff)
downloadpacman-6063424c82f18f3ea8bbf9a92fd30b349ec778bd.tar.gz
pacman-6063424c82f18f3ea8bbf9a92fd30b349ec778bd.tar.xz
Replaced snprintf calls by the SNPRINTF macro to avoid buffer overflows when copying strings
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index dd99313a..1651304f 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -349,7 +349,7 @@ int add_commit(pmdb_t *db, pmtrans_t *trans)
info->reason = PM_PKG_REASON_DEPEND;
}*/
/* make an install date (in UTC) */
- strncpy(info->installdate, asctime(gmtime(&t)), sizeof(info->installdate));
+ STRNCPY(info->installdate, asctime(gmtime(&t)), sizeof(info->installdate));
if(db_write(db, info, INFRQ_ALL)) {
_alpm_log(PM_LOG_ERROR, "could not update database entry %s/%s-%s", db->treename, info->name, info->version);
alpm_logaction(NULL, "error updating database for %s-%s!", info->name, info->version);
@@ -415,7 +415,7 @@ int add_commit(pmdb_t *db, pmtrans_t *trans)
char pathname[PATH_MAX];
struct stat buf;
- strncpy(pathname, th_get_pathname(tar), PATH_MAX);
+ STRNCPY(pathname, th_get_pathname(tar), PATH_MAX);
if(!strcmp(pathname, ".PKGINFO") || !strcmp(pathname, ".FILELIST")) {
tar_skip_regfile(tar);