bugDotGNU Portable.NET - Bugs: bug #26222, negative count for String.CopyTo...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #26222: negative count for String.CopyTo causes segfault

Submitted by:  Thomas Uxiou <uxiou>
Submitted on:  Sat 18 Apr 2009 08:40:50 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Sat 18 Apr 2009 10:28:24 AM UTC, comment #1:

Thanks for the bug report and the patch.
Bug fixed (and two others too) in cvs.

Klaus Treichel <ktreichel>
Project Administrator
Sat 18 Apr 2009 08:40:50 AM UTC, original submission:

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)
# {

Thomas Uxiou <uxiou>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ktreichel (Posted a comment)
  • -unavailable- added by uxiou (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 18 Apr 2009 10:28:24 AM UTCktreichelStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1