[Mono-devel-list] [PATCH] offset validation testing in System.Collections.Specialized.BitVector32.CreateSection()

Alon Gazit along at mainsoft.com
Tue Sep 2 07:37:48 EDT 2003


Hello,

The method
System.Collections.Specialized.BitVector32.CreateSection(short maxValue,
BitVector32.Section previous) should check that the new calculated
offset isn't more than 32 and not that the sum of the new offset and the
number of set bits is more than 32. 

Steps to reproduce the problems:
1. call the method BitVector32.CreateSection(short maxValue) , with
Int16.MaxValue as parameter .
2. call the method BitVector32.CreateSection(short maxValue,
BitVector32.Section previous) , with Int16.MaxValue and the returned
value from the first line as parameters .

Actual Results:
the method throws ArgumentException.

Expected Results:
the method create a new section.

Enclosed is a small test case and a patch.

Thanks a lot,

Alon Gazit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030902/4556a303/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BitVector32.cs.diff
Type: application/octet-stream
Size: 433 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030902/4556a303/attachment.obj 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Test.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030902/4556a303/attachment.pl 


More information about the Mono-devel-list mailing list