loadparm: Fix CID 1273054 Improper use of negative value
authorVolker Lendecke <vl@samba.org>
Thu, 26 Mar 2015 09:14:22 +0000 (10:14 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 26 Mar 2015 13:54:20 +0000 (14:54 +0100)
Probably a "can't happen", but formally lpcfg_map_parameter can return -1

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
lib/param/loadparm.c

index e2b0ca29acc8add6809bf6d00ca4b46b88bf529b..ddb806a238db8276de2e07080f75a4a84541eaff 100644 (file)
@@ -1338,6 +1338,9 @@ bool handle_smb_ports(struct loadparm_context *lp_ctx, struct loadparm_service *
 
        if (parm_num == -1) {
                parm_num = lpcfg_map_parameter("smb ports");
+               if (parm_num == -1) {
+                       return false;
+               }
        }
 
        if(!set_variable_helper(lp_ctx->globals->ctx, parm_num, ptr, "smb ports",