From 6063424c82f18f3ea8bbf9a92fd30b349ec778bd Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Tue, 29 Mar 2005 17:18:59 +0000 Subject: Replaced snprintf calls by the SNPRINTF macro to avoid buffer overflows when copying strings --- lib/libalpm/cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/libalpm/cache.c') diff --git a/lib/libalpm/cache.c b/lib/libalpm/cache.c index 09d508a8..34f3d07c 100644 --- a/lib/libalpm/cache.c +++ b/lib/libalpm/cache.c @@ -28,6 +28,7 @@ #include /* pacman */ #include "list.h" +#include "util.h" #include "package.h" #include "group.h" #include "db.h" @@ -125,7 +126,7 @@ int db_load_grpcache(pmdb_t *db) if(!pm_list_is_strin(i->data, db->grpcache)) { pmgrp_t *grp = grp_new(); - strncpy(grp->name, (char *)i->data, 256); + STRNCPY(grp->name, (char *)i->data, GRP_NAME_LEN); grp->packages = pm_list_add_sorted(grp->packages, pkg->name, grp_cmp); db->grpcache = pm_list_add_sorted(db->grpcache, grp, grp_cmp); } else { -- cgit v1.2.3