1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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>
This commit is contained in:
Swen Schillig 2019-03-06 10:06:35 +01:00 committed by Christof Schmitt
parent 6461a99203
commit beb3012e3f

View File

@ -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;
}