[Mono-bugs] [Bug 335488] New: Marshal.StringToHGlobalAnsi doesn't support embedded '\0' in string

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Oct 20 11:00:52 EDT 2007


           Summary: Marshal.StringToHGlobalAnsi doesn't support embedded
                    '\0' in string
           Product: Mono: Class Libraries
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: doc.formatique at gmail.com
         QAContact: mono-bugs at ximian.com
          Found By: ---

Created an attachment (id=179564)
 --> (https://bugzilla.novell.com/attachment.cgi?id=179564)
Crashing program

System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi is used to translate
a managed string into an unmanaged one. It uses internally g_utf16_to_utf8,
which doesn't support embedded '\0's: (glib 2.14.1)

glib/gutf8.c:1103: while ((len < 0 || in - str < len) && *in)

Whether this is a bug or not in glib is of course a question.

Attached is a testcase working on .Net, not on Mono.

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

More information about the mono-bugs mailing list