From: Swen Schillig Date: Wed, 6 Mar 2019 09:11:39 +0000 (+0100) Subject: source4: Update error check for new string conversion wrapper X-Git-Tag: samba-4.11.0rc1~1338 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=5ff48f64cd541ba021a116f50944341befd97e22;p=samba.git source4: 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 Reviewed-by: Ralph Boehme Reviewed-by: Christof Schmitt --- diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index a8ea6c88459..4c773da5b19 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -3337,7 +3337,7 @@ static int verify_cidr(const char *cidr) goto error; } - if (*endptr != '\0' || endptr == slash + 1 || error != 0){ + if (error != 0 || *endptr != '\0'){ DBG_INFO("CIDR mask is not a proper integer: %s\n", cidr); goto error; } diff --git a/source4/lib/socket/interface.c b/source4/lib/socket/interface.c index 494cbd4fdd2..9bf002c2f01 100644 --- a/source4/lib/socket/interface.c +++ b/source4/lib/socket/interface.c @@ -228,7 +228,7 @@ static void interpret_interface(TALLOC_CTX *mem_ctx, int error = 0; unsigned long val = strtoul_err(p, &endp, 0, &error); - if (p == endp || (endp && *endp != '\0') || error != 0) { + if (error != 0 || *endp != '\0') { DEBUG(2,("interpret_interface: " "can't determine netmask value from %s\n", p));