Skip to content

Commit

Permalink
2006-01-24 Atsushi Enomoto <atsushi@ximian.com>
Browse files Browse the repository at this point in the history
	* object.c, marshal.c : Fixed runtime part of bug #77315. Reject
	  invalid surrogate in UTF7/UTF8 bytes and don't return NULL.


svn path=/trunk/mono/; revision=55978
  • Loading branch information
atsushieno committed Jan 24, 2006
1 parent 7eb82bb commit 3be1eb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions mono/metadata/ChangeLog
@@ -1,3 +1,7 @@
2006-01-24 Atsushi Enomoto <atsushi@ximian.com>

* object.c, marshal.c : Fixed runtime part of bug #77315. Reject
invalid surrogate in UTF7/UTF8 bytes and don't return NULL.

Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>

Expand Down
4 changes: 2 additions & 2 deletions mono/metadata/marshal.c
Expand Up @@ -485,9 +485,9 @@ mono_string_to_lpstr (MonoString *s)

tmp = g_utf16_to_utf8 (mono_string_chars (s), s->length, NULL, &len, &error);
if (error) {
g_warning (error->message);
MonoException *exc = mono_get_exception_argument ("string", error->message);
g_error_free (error);
return NULL;
mono_raise_exception(exc);
}
else {
as = CoTaskMemAlloc (len + 1);
Expand Down
3 changes: 2 additions & 1 deletion mono/metadata/object.c
Expand Up @@ -3234,8 +3234,9 @@ mono_string_to_utf8 (MonoString *s)

as = g_utf16_to_utf8 (mono_string_chars (s), s->length, NULL, NULL, &error);
if (error) {
g_warning (error->message);
MonoException *exc = mono_get_exception_argument ("string", error->message);
g_error_free (error);
mono_raise_exception(exc);
}

return as;
Expand Down

0 comments on commit 3be1eb2

Please sign in to comment.