On Feb 1, 2008, at 12:57 PM, Matthew Toseland wrote:

> On Friday 01 February 2008 18:51, Robert Hailey wrote:
>>
>> I'm not really sure this is so much a bug as garbage-in-garbage-out.
>>
>> By the code provided, the size for the bitarray is given first, then
>> the raw data; it just so happens that when you translate the first
>> several bytes of "testString" into an integer, it comes out to be  
>> very
>> large number (more bytes than are available for allocation). Note  
>> that
>> there *is* a legitimate bitarray data stream which will begin with
>> "testString".asBytes(), it is probably just too large for practical  
>> use.
>
> Do we use this anywhere, that is the question?

Yes, when reading a DMT.packetTransmit; It is  
"freenet.support.BitArray", but it has the same issue.

We could either put a hard-coded cap in BitArray (ugly), or make  
another constructor with a maximum allowable size (from Serializer).

Fixed in r17464.

--
Robert Hailey


Reply via email to