[Bug 1547060] Re: cant use -d switch
Ubuntu Foundations Team Bug Bot
1547060 at bugs.launchpad.net
Thu Apr 21 16:24:34 UTC 2016
The attachment "fix-errno-parsing.debdiff" seems to be a debdiff. The
ubuntu-sponsors team has been subscribed to the bug report so that they
can review and hopefully sponsor the debdiff. If the attachment isn't a
patch, please remove the "patch" flag from the attachment, remove the
"patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe
the team.
[This is an automated message performed by a Launchpad user owned by
~brian-murray, for any issue please contact him.]
** Tags added: patch
--
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1547060
Title:
cant use -d switch
Status in tgt package in Ubuntu:
Confirmed
Status in tgt package in Debian:
Unknown
Bug description:
tgt-1:1.0.62-1ubuntu2
# ./tgtd -d 1
-d argument value '1' invalid
Try `tgtd --help' for more information.
The following change should fix the problem:
--- util.h.old 2015-12-02 03:27:15.000000000 +0300
+++ util.h 2016-02-18 18:04:08.749932076 +0300
@@ -148,7 +148,7 @@
unsigned long long ull_val; \
ull_val = strtoull(str, &ptr, 0); \
val = (typeof(val)) ull_val; \
- if (errno || ptr == str) \
+ if (ull_val == ULONG_MAX || ptr == str) \
ret = EINVAL; \
else if (val != ull_val) \
ret = ERANGE; \
Here, the errno is checked incorrectly: you can't check
errno unless the returned value allows you to. In case
of strtoull(), errno should be checked only if ULONG_MAX is
returned.
I however can't test the fix properly because when compiled
from source, the bug doesn't happen. The value of errno is
unspecified, and it just happens to be 0 when I compile from
sources.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tgt/+bug/1547060/+subscriptions
More information about the Ubuntu-sponsors
mailing list