From 0db91763add9cc4b021602be56c9d40cbe843cfb Mon Sep 17 00:00:00 2001 From: joerg Date: Sun, 10 Aug 2008 22:09:38 +0000 Subject: Explicitly initialise plist in parse_plist. --- pkgtools/pkg_install/files/info/perform.c | 5 ++--- pkgtools/pkg_install/files/lib/pkg_signature.c | 6 ++---- pkgtools/pkg_install/files/lib/plist.c | 7 +++++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgtools/pkg_install/files/info/perform.c b/pkgtools/pkg_install/files/info/perform.c index 37d02712d7b..318e3183ac6 100644 --- a/pkgtools/pkg_install/files/info/perform.c +++ b/pkgtools/pkg_install/files/info/perform.c @@ -1,4 +1,4 @@ -/* $NetBSD: perform.c,v 1.46.2.4 2008/08/02 20:33:50 joerg Exp $ */ +/* $NetBSD: perform.c,v 1.46.2.5 2008/08/10 22:09:38 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -17,7 +17,7 @@ #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.23 1997/10/13 15:03:53 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.46.2.4 2008/08/02 20:33:50 joerg Exp $"); +__RCSID("$NetBSD: perform.c,v 1.46.2.5 2008/08/10 22:09:38 joerg Exp $"); #endif #endif @@ -377,7 +377,6 @@ pkg_do(const char *pkg) package_t plist; /* Read the contents list */ - plist.head = plist.tail = NULL; parse_plist(&plist, meta->meta_contents); /* Start showing the package contents */ diff --git a/pkgtools/pkg_install/files/lib/pkg_signature.c b/pkgtools/pkg_install/files/lib/pkg_signature.c index 38b46f36c1d..d6db90005ad 100644 --- a/pkgtools/pkg_install/files/lib/pkg_signature.c +++ b/pkgtools/pkg_install/files/lib/pkg_signature.c @@ -1,4 +1,4 @@ -/* $NetBSD: pkg_signature.c,v 1.1.2.5 2008/08/02 20:33:50 joerg Exp $ */ +/* $NetBSD: pkg_signature.c,v 1.1.2.6 2008/08/10 22:09:38 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include #endif -__RCSID("$NetBSD: pkg_signature.c,v 1.1.2.5 2008/08/02 20:33:50 joerg Exp $"); +__RCSID("$NetBSD: pkg_signature.c,v 1.1.2.6 2008/08/10 22:09:38 joerg Exp $"); /*- * Copyright (c) 2008 Joerg Sonnenberger . @@ -460,8 +460,6 @@ extract_pkgname(int fd) archive_read_finish(a); - plist.head = NULL; - plist.tail = NULL; parse_plist(&plist, buf); free(buf); p = find_plist(&plist, PLIST_NAME); diff --git a/pkgtools/pkg_install/files/lib/plist.c b/pkgtools/pkg_install/files/lib/plist.c index af53de9ed7a..63a5aab45a0 100644 --- a/pkgtools/pkg_install/files/lib/plist.c +++ b/pkgtools/pkg_install/files/lib/plist.c @@ -1,4 +1,4 @@ -/* $NetBSD: plist.c,v 1.17.4.8 2008/08/10 22:08:17 joerg Exp $ */ +/* $NetBSD: plist.c,v 1.17.4.9 2008/08/10 22:09:38 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -11,7 +11,7 @@ #if 0 static const char *rcsid = "from FreeBSD Id: plist.c,v 1.24 1997/10/08 07:48:15 charnier Exp"; #else -__RCSID("$NetBSD: plist.c,v 1.17.4.8 2008/08/10 22:08:17 joerg Exp $"); +__RCSID("$NetBSD: plist.c,v 1.17.4.9 2008/08/10 22:09:38 joerg Exp $"); #endif #endif @@ -309,6 +309,9 @@ parse_plist(package_t *pkg, const char *buf) const char *eol, *next; size_t len; + pkg->head = NULL; + pkg->tail = NULL; + for (; *buf; buf = next) { /* Until add_plist can deal with trailing whitespace. */ if ((eol = strchr(buf, '\n')) != NULL) { -- cgit v1.2.3