From: Guillem Jover Date: Wed, 2 Jul 2008 05:39:19 +0000 (+0300) Subject: libdpkg: Print a longer string when an unknown field value is found X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9274078c46b368d4bbcbfa9bd9b62d67fd0f0531;p=dpkg 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. --- 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;