summaryrefslogtreecommitdiff
path: root/libcli/security
diff options
context:
space:
mode:
authorSwen Schillig <swen@linux.ibm.com>2019-03-06 10:06:35 +0100
committerChristof Schmitt <cs@samba.org>2019-04-11 22:29:27 +0000
commitbeb3012e3f9ebf5dceb1cc1db4f9f34e22bc8286 (patch)
treece48cbc45ae593c26334ceca2800eb323f4d7bfb /libcli/security
parent6461a9920393b6e56f807b68d738089adbd55cd5 (diff)
downloadsamba-beb3012e3f9ebf5dceb1cc1db4f9f34e22bc8286.tar.gz
libcli: Update error check for new string conversion wrapper
The new string conversion wrappers detect and flag errors which occured during the string to integer conversion. Those modifications required an update of the callees error checks. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
Diffstat (limited to 'libcli/security')
-rw-r--r--libcli/security/dom_sid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcli/security/dom_sid.c b/libcli/security/dom_sid.c
index ca7fd874752..ac34a92f19c 100644
--- a/libcli/security/dom_sid.c
+++ b/libcli/security/dom_sid.c
@@ -149,7 +149,7 @@ bool dom_sid_parse_endp(const char *sidstr,struct dom_sid *sidout,
}
conv = strtoul_err(p, &q, 10, &error);
- if (!q || (*q != '-') || conv > UINT8_MAX || error != 0) {
+ if (error != 0 || (*q != '-') || conv > UINT8_MAX) {
goto format_error;
}
sidout->sid_rev_num = (uint8_t) conv;
@@ -161,7 +161,7 @@ bool dom_sid_parse_endp(const char *sidstr,struct dom_sid *sidout,
/* get identauth */
conv = strtoull_err(q, &q, 0, &error);
- if (!q || conv & AUTHORITY_MASK || error != 0) {
+ if (conv & AUTHORITY_MASK || error != 0) {
goto format_error;
}
@@ -190,7 +190,7 @@ bool dom_sid_parse_endp(const char *sidstr,struct dom_sid *sidout,
}
conv = strtoull_err(q, &end, 10, &error);
- if (end == q || conv > UINT32_MAX || error != 0) {
+ if (conv > UINT32_MAX || error != 0) {
goto format_error;
}