diff --git a/libcli/smb/smb2_lease.c b/libcli/smb/smb2_lease.c index 442bdc60021..d28477b1911 100644 --- a/libcli/smb/smb2_lease.c +++ b/libcli/smb/smb2_lease.c @@ -52,9 +52,11 @@ ssize_t smb2_lease_pull(const uint8_t *buf, size_t len, case 1: break; case 2: - memcpy(&lease->parent_lease_key, buf+32, 16); lease->lease_flags = IVAL(buf, 20); lease->lease_flags &= SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET; + if (lease->lease_flags & SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET) { + memcpy(&lease->parent_lease_key, buf+32, 16); + } lease->lease_duration = BVAL(buf, 24); lease->lease_epoch = SVAL(buf, 48); break; diff --git a/selftest/knownfail.d/samba3.smb2.lease b/selftest/knownfail.d/samba3.smb2.lease deleted file mode 100644 index c3084dc5ad2..00000000000 --- a/selftest/knownfail.d/samba3.smb2.lease +++ /dev/null @@ -1 +0,0 @@ -^samba3.smb2.lease.v2_flags_parentkey\(fileserver\)