[Reproducible-commits] [dpkg] 42/74: dpkg-query: Fix strtol() errno check when parsing the COLUMNS envvar
Mattia Rizzolo
mattia at debian.org
Sun Jul 3 22:22:55 UTC 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to annotated tag 1.18.8
in repository dpkg.
commit 4ae57cb6d964e4c98ea1330ac192b2948b2b1724
Author: Sven Joachim <svenjoac at gmx.de>
Date: Mon Jun 20 23:28:03 2016 +0200
dpkg-query: Fix strtol() errno check when parsing the COLUMNS envvar
Regression introduced in commit 3d258742dfe5cd18e4e06a5fbd855b99bb95046e.
Closes: #827265
Signed-off-by: Guillem Jover <guillem at debian.org>
---
debian/changelog | 2 ++
src/querycmd.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 2fe7b43..57d3756 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -25,6 +25,8 @@ dpkg (1.18.8) UNRELEASED; urgency=medium
* Activate file triggers for conffiles on purge, which has never happened
before. Before dpkg 1.17.0, conffiles were triggered on removal, which
was obviously wrong. Reported by Helmut Grohne <helmut at subdivi.de>.
+ * Fix strtol() errno check when parsing the COLUMNS envvar in dpkg-query.
+ Thanks to Sven Joachim <svenjoac at gmx.de>. Closes: #827265
* Perl modules:
- Use warnings::warnif() instead of carp() for deprecated warnings.
- Add new format_range() method and deprecate dpkg() and rfc822() methods
diff --git a/src/querycmd.c b/src/querycmd.c
index cdc1399..127f0c8 100644
--- a/src/querycmd.c
+++ b/src/querycmd.c
@@ -74,7 +74,7 @@ static int getwidth(void) {
if (columns) {
errno = 0;
res = strtol(columns, &endptr, 10);
- if (errno != 0 && columns != endptr && *endptr == '\0' &&
+ if (errno == 0 && columns != endptr && *endptr == '\0' &&
res > 0 && res < INT_MAX)
return res;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list