[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet] [bug #26222] negative count for String.CopyTo causes segfa
From: |
Thomas Uxiou |
Subject: |
[Dotgnu-pnet] [bug #26222] negative count for String.CopyTo causes segfault |
Date: |
Sat, 18 Apr 2009 08:40:52 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en; rv:1.9.0.8) Gecko/20080528 Epiphany/2.22 Firefox/3.0 |
URL:
<http://savannah.gnu.org/bugs/?26222>
Summary: negative count for String.CopyTo causes segfault
Project: DotGNU Portable.NET
Submitted by: uxiou
Submitted on: Sat Apr 18 08:40:50 2009
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
char[] dest = new char[2];
"Foo".CopyTo(0, dest, 0, -1);
patch:
# diff -u a/runtime/System/String.cs b/runtime/System/String.cs
# --- a/runtime/System/String.cs
# +++ b/runtime/System/String.cs
# @@ -697,6 +697,11 @@ public sealed class String : IComparable, ICloneable,
IEnumerable
# throw new ArgumentOutOfRangeException
# ("destinationIndex",
_("ArgRange_Array"));
# }
# + else if(count < 0)
# + {
# + throw new ArgumentOutOfRangeException
# + ("count",
_("ArgRange_StringRange"));
# + }
# else if((length - sourceIndex) < count ||
# (destination.Length -
destinationIndex) < count)
# {
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?26222>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Dotgnu-pnet] [bug #26222] negative count for String.CopyTo causes segfault,
Thomas Uxiou <=