Skip to content

Commit

Permalink
Explicitly initialise plist in parse_plist.
Browse files Browse the repository at this point in the history
  • Loading branch information
joerg committed Aug 10, 2008
1 parent 9d7fc16 commit 8c84e46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
5 changes: 2 additions & 3 deletions 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"
Expand All @@ -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

Expand Down Expand Up @@ -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 */
Expand Down
6 changes: 2 additions & 4 deletions 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"
Expand All @@ -7,7 +7,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#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 <joerg@NetBSD.org>.
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions 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"
Expand All @@ -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

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8c84e46

Please sign in to comment.