summaryrefslogtreecommitdiff
path: root/source4/torture/gentest.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-06-06 10:54:17 -0700
committerAndrew Tridgell <tridge@samba.org>2008-06-06 10:54:17 -0700
commit8e45338c8d5155376d511dcfda2f6d663de19159 (patch)
tree653f27eb3b77d4497e703c6cea08f194bac9d67c /source4/torture/gentest.c
parent3df3bf577d5510f30aceca13b6be29267c1c6380 (diff)
downloadsamba-8e45338c8d5155376d511dcfda2f6d663de19159.tar.gz
handle NULL fields in blob comparison
(This used to be commit 0643b5a2bfc401d8318964241ad522eb427a170e)
Diffstat (limited to 'source4/torture/gentest.c')
-rw-r--r--source4/torture/gentest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index 60243a5d1b8..15cf3219653 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; \