[Mono-bugs] [Bug 573682] segtaults when encoding/decoding non-UTF8 strings

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 27 19:13:15 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=573682

http://bugzilla.novell.com/show_bug.cgi?id=573682#c11


--- Comment #11 from Zoltan Varga <vargaz at gmail.com> 2010-01-28 00:13:14 UTC ---
Using this patch:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
diff --git a/class/I18N/West/CP1252.cs b/class/I18N/West/CP1252.cs
index fa0d361..2a4e702 100644
--- a/class/I18N/West/CP1252.cs
+++ b/class/I18N/West/CP1252.cs
@@ -98,6 +98,7 @@ public class CP1252 : ByteEncoding
                while(charCount > 0)
                {
                        ch = (int)(chars[charIndex++]);
+                       --charCount;
                        if(ch >= 128) switch(ch)
                        {
                                case 0x0081:
@@ -244,7 +245,6 @@ public class CP1252 : ByteEncoding
                                break;
                        }
                        bytes[byteIndex++] = (byte)ch;
-                       --charCount;
                        --byteCount;
                }
        }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Your testcase runs for me.

-- 
Configure bugmail: http://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