summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2013-09-12 07:28:28 +0000
committerwiz <wiz@pkgsrc.org>2013-09-12 07:28:28 +0000
commitebdd192eb09a068bfa201677011aa747271e7cea (patch)
treea64628716b20e3c2acc1acb548dcb77cad37920a /pkgtools/pkg_install
parent3100fff42d3e2da74e829bc14cba6114721c1679 (diff)
downloadpkgsrc-ebdd192eb09a068bfa201677011aa747271e7cea.tar.gz
Fix pkg_info -X segfault when last entry wasn't terminated with \n.
Addresses PR 48207.
Diffstat (limited to 'pkgtools/pkg_install')
-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++) {