fix(desktop): stop shortcut repair from corrupting the heap (#1552)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-11 12:06:34 +02:00
1 parent e1437fe564
commit f9295dcc06
1 file changed
+4 -4
+4 -4
View File
@@ -499,9 +499,9 @@ mod platform {
) -> Result<()> { ) -> Result<()> {
let mut wide = wide_null(value); let mut wide = wide_null(value);
unsafe { unsafe {
let prop = propvariant_from_wide_string(&mut wide); let prop = ManuallyDrop::new(propvariant_from_wide_string(&mut wide));
property_store property_store
.SetValue(key as *const PROPERTYKEY, &prop as *const PROPVARIANT) .SetValue(key as *const PROPERTYKEY, &*prop as *const PROPVARIANT)
.map_err(|err| hresult_error(label, err)) .map_err(|err| hresult_error(label, err))
} }
} }
@@ -516,9 +516,9 @@ mod platform {
unsafe { unsafe {
let mut guid = CLSIDFromString(PCWSTR(wide.as_ptr())) let mut guid = CLSIDFromString(PCWSTR(wide.as_ptr()))
.map_err(|err| hresult_error("CLSIDFromString failed", err))?; .map_err(|err| hresult_error("CLSIDFromString failed", err))?;
let prop = propvariant_from_guid(&mut guid); let prop = ManuallyDrop::new(propvariant_from_guid(&mut guid));
property_store property_store
.SetValue(key as *const PROPERTYKEY, &prop as *const PROPVARIANT) .SetValue(key as *const PROPERTYKEY, &*prop as *const PROPVARIANT)
.map_err(|err| hresult_error(label, err)) .map_err(|err| hresult_error(label, err))
} }
} }