diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-06-06 10:54:17 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-06-06 10:54:17 -0700 |
commit | 8e45338c8d5155376d511dcfda2f6d663de19159 (patch) | |
tree | 653f27eb3b77d4497e703c6cea08f194bac9d67c /source4/torture | |
parent | 3df3bf577d5510f30aceca13b6be29267c1c6380 (diff) | |
download | samba-8e45338c8d5155376d511dcfda2f6d663de19159.tar.gz samba-8e45338c8d5155376d511dcfda2f6d663de19159.tar.bz2 samba-8e45338c8d5155376d511dcfda2f6d663de19159.zip |
handle NULL fields in blob comparison
(This used to be commit 0643b5a2bfc401d8318964241ad522eb427a170e)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/gentest.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; \ |