From 9274078c46b368d4bbcbfa9bd9b62d67fd0f0531 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 2 Jul 2008 08:39:19 +0300 Subject: [PATCH] libdpkg: Print a longer string when an unknown field value is found Use a capped string length instead of using last namevalue length member when printing the disallowed value when parsing. --- ChangeLog | 6 ++++++ debian/changelog | 1 + lib/fields.c | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 33a6345a..9021adc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-02 Guillem Jover + + * lib/fields.c (convert_string): Use a capped string length instead + of using last namevalue length member when printing the disallowed + value. + 2008-07-02 Guillem Jover * src/query.c (limiteddescription): Use NULL instead of 0. diff --git a/debian/changelog b/debian/changelog index d648b38e..ef049829 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,7 @@ dpkg (1.15.0) UNRELEASED; urgency=low * Do not allocate memory when lstat fails during package upgrade. * Properly lstat the correct file when using --root on package upgrade. Thanks to Egmont Koblinger. Closes: #281057 + * Print a longer string when a disallowed field value is found when parsing. [ Raphael Hertzog ] * Enhance dpkg-shlibdeps's error message when a library can't be found to diff --git a/lib/fields.c b/lib/fields.c index cf7ed762..0ef20a84 100644 --- a/lib/fields.c +++ b/lib/fields.c @@ -24,6 +24,7 @@ #include #include #include +#include "strnlen.h" #include #include @@ -57,7 +58,7 @@ convert_string(const char *filename, int lno, const char *what, int otherwise, if (!nvip->name) { if (otherwise != -1) return otherwise; parse_error(filename, lno, pigp, _("`%.*s' is not allowed for %s"), - l > 50 ? 50 : l, startp, what); + strnlen(startp, 50), startp, what); } ep = startp + l; c = *ep; -- 2.39.5