summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorwiz <wiz>2013-09-12 07:28:28 +0000
committerwiz <wiz>2013-09-12 07:28:28 +0000
commit51664778e0bd471c32e7ef8a8258473a36eb2a44 (patch)
treea64628716b20e3c2acc1acb548dcb77cad37920a /pkgtools
parent93e92fb6fef74c8d20429537a759dd79163a262f (diff)
downloadpkgsrc-51664778e0bd471c32e7ef8a8258473a36eb2a44.tar.gz
Fix pkg_info -X segfault when last entry wasn't terminated with \n.
Addresses PR 48207.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/lib/var.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkgtools/pkg_install/files/lib/var.c b/pkgtools/pkg_install/files/lib/var.c
index c212df0e9e7..9e9b65f4bba 100644
--- a/pkgtools/pkg_install/files/lib/var.c
+++ b/pkgtools/pkg_install/files/lib/var.c
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.9 2013/05/17 07:27:29 martin Exp $ */
+/* $NetBSD: var.c,v 1.10 2013/09/12 07:28:28 wiz Exp $ */
/*-
* Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: var.c,v 1.9 2013/05/17 07:27:29 martin Exp $");
+__RCSID("$NetBSD: var.c,v 1.10 2013/09/12 07:28:28 wiz Exp $");
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -60,7 +60,7 @@ static const char *var_cmp(const char *, size_t, const char *, size_t);
static void var_print(FILE *, const char *, const char *);
/*
- * Copy the specified varibales from the file fname to stdout.
+ * Copy the specified variables from the file fname to stdout.
*/
int
var_copy_list(const char *buf, const char **variables)
@@ -74,8 +74,8 @@ var_copy_list(const char *buf, const char **variables)
next = eol + 1;
len = eol - buf;
} else {
- next = eol;
len = strlen(buf);
+ next = buf + len;
}
for (i=0; variables[i]; i++) {