summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorSwen Schillig <swen@linux.ibm.com>2019-03-06 10:11:39 +0100
committerChristof Schmitt <cs@samba.org>2019-04-11 22:29:27 +0000
commit5ff48f64cd541ba021a116f50944341befd97e22 (patch)
treeb34fadc0499cf7e97e0b92fa2193506830cdd4af /source4
parentbeb3012e3f9ebf5dceb1cc1db4f9f34e22bc8286 (diff)
downloadsamba-5ff48f64cd541ba021a116f50944341befd97e22.tar.gz
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 <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c2
-rw-r--r--source4/lib/socket/interface.c2
2 files changed, 2 insertions, 2 deletions
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));