From: Andrew Bartlett Date: Wed, 20 Nov 2019 05:54:28 +0000 (+1300) Subject: ndrdump: Do not run the validate step after a failure X-Git-Tag: ldb-2.1.0~491 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b866018c2c89f6118c18d7a3527a0fa6d9916b9e;p=thirdparty%2Fsamba.git ndrdump: Do not run the validate step after a failure This avoids ending a failed parse with 'dump OK' Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c index 23fbfa67282..914c67e98e2 100644 --- a/librpc/tools/ndrdump.c +++ b/librpc/tools/ndrdump.c @@ -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;