From 8e45338c8d5155376d511dcfda2f6d663de19159 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 6 Jun 2008 10:54:17 -0700 Subject: handle NULL fields in blob comparison (This used to be commit 0643b5a2bfc401d8318964241ad522eb427a170e) --- source4/torture/gentest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/torture') diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index 60243a5d1b..15cf321965 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -1459,7 +1459,9 @@ again: } while(0) #define CHECK_BLOB_EQUAL(field) do { \ - if (memcmp(parm[0].field.data, parm[1].field.data, parm[0].field.length) != 0 && !ignore_pattern(#field)) { \ + if (((parm[0].field.data == NULL && parm[1].field.data != NULL) || \ + (parm[1].field.data == NULL && parm[0].field.data != NULL) || \ + (memcmp(parm[0].field.data, parm[1].field.data, parm[0].field.length) != 0)) && !ignore_pattern(#field)) { \ current_op.mismatch = #field; \ printf("Mismatch in %s\n", #field); \ return false; \ -- cgit