Fix setinteger() funtion used for parsing integer options to refuse empty parameters. Currently only affects --abort-after. Based-on-patch-by: Bill Allombert <ballombe@debian.org>
@@ -17,6 +17,7 @@ Bart Martens <bart.martens@advalvas.be>
Bastian Kleineidam <calvin@debian.org>
Ben Collins <bcollins@debian.org>
Ben Pfaff <blp@cs.stanford.edu>
+Bill Allombert <ballombe@debian.org>
Branden Robinson <branden@debian.org>
Branko Lankester
Brian M. Carlson <sandals@crustytoothpaste.ath.cx>
@@ -43,6 +43,8 @@ dpkg (1.15.1) UNRELEASED; urgency=low
arguments starting with a dash are not interpreted as options.
Closes: #293163
Thanks to Bill Allombert for the patch.
+ * dpkg now correctly refuses empty parameters when an integer value is
+ wanted. Closes: #386197 Based on a patch by Bill Allombert.
[ Guillem Jover ]
* Fix typo in dpkg output (‘unexecpted’ → ‘unexpected’). Closes: #519082
@@ -293,7 +293,7 @@ static void setinteger(const struct cmdinfo *cip, const char *value) {
char *ep;
v= strtoul(value,&ep,0);
- if (*ep || v > INT_MAX)
+ if (!*value || *ep || v > INT_MAX)
badusage(_("invalid integer for --%s: `%.250s'"),cip->olong,value);
*cip->iassignto= v;
}