Esme Povirk (@madewokherd) commented about dlls/shell32/shlfileop.c:
-static inline struct file_operation *impl_from_IFileOperation(IFileOperation *iface) +static HRESULT add_operation( IShellItem *item, IShellItem *folder,
LPCWSTR name, UINT func, struct file_operation **out)
+{
- LPWSTR tmp, from, to = NULL;
- HRESULT ret;
- if (!out) return ERROR_INVALID_PARAMETER;
- ret = IShellItem_GetDisplayName(item, SIGDN_FILESYSPATH, &tmp);
- if (S_OK != ret)
- {
return ERROR_INVALID_PARAMETER;
- }
- from = calloc(lstrlenW(tmp) + 2, sizeof(WCHAR));
If you're just allocating enough to hold the name, I think it should be `+ 1` for the NULL terminator.