source4: Update error check for new string conversion wrapper
authorSwen Schillig <swen@linux.ibm.com>
Wed, 6 Mar 2019 09:11:39 +0000 (10:11 +0100)
committerChristof Schmitt <cs@samba.org>
Thu, 11 Apr 2019 22:29:27 +0000 (22:29 +0000)
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>
source4/dsdb/samdb/ldb_modules/samldb.c
source4/lib/socket/interface.c

index a8ea6c8845955963ed93aac2730aa06aaaadeab0..4c773da5b19473957fb5992e0b3eb7294ecaf8bf 100644 (file)
@@ -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;
        }
index 494cbd4fdd294baf7a4c96f6b917bc925e5cb963..9bf002c2f01fecb1741af77cd4f7b01bfc21325f 100644 (file)
@@ -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));