Author: tridge Date: 2004-08-25 00:04:47 +0000 (Wed, 25 Aug 2004) New Revision: 2031
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=2031&nolog=1 Log: add a check for a blank secret return in lsa secret tests Modified: branches/SAMBA_4_0/source/torture/rpc/lsa.c Changeset: Modified: branches/SAMBA_4_0/source/torture/rpc/lsa.c =================================================================== --- branches/SAMBA_4_0/source/torture/rpc/lsa.c 2004-08-24 23:58:00 UTC (rev 2030) +++ branches/SAMBA_4_0/source/torture/rpc/lsa.c 2004-08-25 00:04:47 UTC (rev 2031) @@ -463,18 +463,23 @@ ret = False; } - blob1.data = r4.out.new_val->buf->data; - blob1.length = r4.out.new_val->buf->length; + if (r4.out.new_val->buf == NULL) { + printf("No secret buffer returned\n"); + ret = False; + } else { + blob1.data = r4.out.new_val->buf->data; + blob1.length = r4.out.new_val->buf->length; - blob2 = data_blob(NULL, blob1.length); + blob2 = data_blob(NULL, blob1.length); - secret2 = sess_decrypt_string(&blob1, &session_key); + secret2 = sess_decrypt_string(&blob1, &session_key); - printf("returned secret '%s'\n", secret2); + printf("returned secret '%s'\n", secret2); - if (strcmp(secret1, secret2) != 0) { - printf("Returned secret doesn't match\n"); - ret = False; + if (strcmp(secret1, secret2) != 0) { + printf("Returned secret doesn't match\n"); + ret = False; + } } if (!test_Delete(p, mem_ctx, &sec_handle)) {