]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ndrdump: Do not run the validate step after a failure
authorAndrew Bartlett <abartlet@samba.org>
Wed, 20 Nov 2019 05:54:28 +0000 (18:54 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 29 Nov 2019 00:44:41 +0000 (00:44 +0000)
This avoids ending a failed parse with 'dump OK'

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

index 23fbfa672821a858ac6df56c1c20b1d7534a7dc0..914c67e98e2124ebe3237c41ac635ede47e1ad8b 100644 (file)
@@ -638,6 +638,14 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
                }
        }
 
+       /* Do not proceed to validate if we got an error */
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               printf("dump of failed-to-parse %s complete\n",
+                      f->name);
+               TALLOC_FREE(mem_ctx);
+               exit(2);
+       }
+
        if (validate) {
                DATA_BLOB v_blob;
                struct ndr_push *ndr_v_push;