libcli/security: Make failure parsing where consumed == -1 clear
authorAndrew Bartlett <abartlet@samba.org>
Wed, 20 Sep 2023 23:56:25 +0000 (11:56 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Sep 2023 23:45:36 +0000 (23:45 +0000)
This was caught by the next condition, but this is clearer.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
libcli/security/conditional_ace.c

index 2957dc20319d17c19f465506cb61918d78995837..bc4f929ff6b63d0de80073c91dfe1d8aa39e7f35 100644 (file)
@@ -708,6 +708,9 @@ struct ace_condition_script *parse_conditional_ace(TALLOC_CTX *mem_ctx,
                        goto fail;
                }
 
+               if (consumed < 0) {
+                       goto fail;
+               }
                if (consumed + i < i || consumed + i > data.length) {
                        goto fail;
                }