msi: ExpandEnvironmentStringsW returns the required size in characters, so multiply the required size by sizeof(WCHAR) when allocating the buffer.

James Hawkins truiken at gmail.com
Wed Dec 2 19:34:40 CST 2009


Fixes several valgrind errors of the form:

Invalid write of size 1
    at  memcpy (mc_replace_strmem.c:482)
    by  RtlExpandEnvironmentStrings_U (env.c:338)
    by  ExpandEnvironmentStringsW (environ.c:375)
    by  variant_from_registry_value (automation.c:1503)
    by  InstallerImpl_Invoke (automation.c:1753)
    by  AutomationObject_Invoke (automation.c:398)
    by  invoke (automation.c:691)
    by  Installer_RegistryValue (automation.c:745)
    by  Installer_RegistryValueW (automation.c:772)
    by  test_Installer_RegistryValue (automation.c:1923)
    by  test_Installer (automation.c:2438)
    by  func_automation (automation.c:2520)
    by  run_test (test.h:535)
    by  main (test.h:585)
  Address 0x7f3c3827 is 2 bytes after a block of size 5 alloc'd
    at  notify_alloc (heap.c:247)
    by  RtlAllocateHeap (heap.c:1697)
    by  msi_alloc (msipriv.h:1078)
    by  variant_from_registry_value (automation.c:1501)
    by  InstallerImpl_Invoke (automation.c:1753)
    by  AutomationObject_Invoke (automation.c:398)
    by  invoke (automation.c:691)
    by  Installer_RegistryValue (automation.c:745)
    by  Installer_RegistryValueW (automation.c:772)
    by  test_Installer_RegistryValue (automation.c:1923)
    by  test_Installer (automation.c:2438)
    by  func_automation (automation.c:2520)
    by  run_test (test.h:535)
    by  main (test.h:585)

---
 dlls/msi/automation.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-msi-ExpandEnvironmentStringsW-returns-the-required-s.patch
Type: text/x-patch
Size: 1232 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20091202/a33c65d3/attachment.bin>


More information about the wine-patches mailing list