[Mono-bugs] [Bug 549173] mono_string_builder_to_utf16() returns unitialized data

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 22 15:37:09 EDT 2009


User hib at hiberis.nl added comment

--- Comment #2 from Hib Eris <hib at hiberis.nl>  2009-10-22 21:37:05 CEST ---
I have no proper testcase.

It fixes the problem I had with running 'light' from the Windows Installer Xml
toolkit though.

That does something like:

[DllImport("msi.dll", EntryPoint = "MsiGetFileVersionW", CharSet =
CharSet.Unicode, ExactSpelling = true)]
internal static extern int MsiGetFileVersion(string filePath, StringBuilder
versionBuf, ref int versionBufSize, StringBuilder langBuf, ref int

filepath = "some_non_existing_name";
int versionLength = 20;
int languageLength = 20;
StringBuilder versionBuffer = new StringBuilder(versionLength);
StringBuilder languageBuffer = new StringBuilder(languageLength);

error = MsiGetFileVersion(filePath, versionBuffer, ref versionLength,
languageBuffer, ref languageLength);

The dll function MsiGetFileVersion does not set versionBuffer when it fails,
thus it should not return a StringBuilder versionBuffer with random bits from
memory. With the patch applied it works fine. Thanks.

(I am running this under Wine, with Mono for Windows)

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list