From e3782beb9f112e4f4f3b41cf809f639e852932f5 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 17 Feb 2016 20:21:39 -0600 Subject: [PATCH] win32_capture: handle NtQuerySecurityObject returning an empty descriptor --- src/win32_capture.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/win32_capture.c b/src/win32_capture.c index 951f61bf..4bc0f7c2 100644 --- a/src/win32_capture.c +++ b/src/win32_capture.c @@ -634,8 +634,13 @@ winnt_load_security_descriptor(HANDLE h, struct wim_inode *inode, } } + /* We can get a length of 0 with Samba. Assume that means "no security + * descriptor". */ + if (len_needed == 0) + goto out; + /* Add the security descriptor to the WIM image, and save its ID in - * file's inode. */ + * the file's inode. */ inode->i_security_id = sd_set_add_sd(ctx->params->sd_set, buf, len_needed); if (unlikely(inode->i_security_id < 0)) status = STATUS_NO_MEMORY; -- 2.43.0