From 498b2892dd598737900429584a01df76325ffa8f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 10 Nov 2005 12:29:44 +0000 Subject: r11638: fixed handling of null volume name in RAW-QFSINFO test thanks to Stephen Zarkos for finding this (This used to be commit 8331eee64cb679c091ca46cc001ff9851eb91f0e) --- source4/torture/raw/qfsinfo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/torture/raw/qfsinfo.c') diff --git a/source4/torture/raw/qfsinfo.c b/source4/torture/raw/qfsinfo.c index 7576c4b22a..9d3b703456 100644 --- a/source4/torture/raw/qfsinfo.c +++ b/source4/torture/raw/qfsinfo.c @@ -83,9 +83,8 @@ static union smb_fsinfo *find(const char *name) ret = False; \ }} while(0) -#define STR_EQUAL(n1, v1, n2, v2) do {if (!s1->n1.out.v1 && !s2->n2.out.v2) return True; \ - if (!s1->n1.out.v1 || !s2->n2.out.v2) return False; \ - if (strcmp(s1->n1.out.v1, s2->n2.out.v2)) { \ +#define STR_EQUAL(n1, v1, n2, v2) do { \ + if (strcmp_safe(s1->n1.out.v1, s2->n2.out.v2)) { \ printf("%s/%s [%s] != %s/%s [%s] at %s(%d)\n", \ #n1, #v1, s1->n1.out.v1, \ #n2, #v2, s2->n2.out.v2, \ @@ -287,7 +286,7 @@ BOOL torture_raw_qfsinfo(void) #define STR_CHECK(sname, stype, field, flags) do { \ s1 = find(sname); \ if (s1) { \ - if (wire_bad_flags(&s1->stype.out.field, flags, cli)) { \ + if (s1->stype.out.field.s && wire_bad_flags(&s1->stype.out.field, flags, cli)) { \ printf("(%d) incorrect string termination in %s/%s\n", \ __LINE__, #stype, #field); \ ret = False; \ @@ -295,6 +294,7 @@ BOOL torture_raw_qfsinfo(void) }} while (0) printf("check for correct termination\n"); + STR_CHECK("VOLUME", volume, volume_name, 0); STR_CHECK("VOLUME_INFO", volume_info, volume_name, STR_UNICODE); STR_CHECK("VOLUME_INFORMATION", volume_info, volume_name, STR_UNICODE); -- cgit