Closed creswick closed 10 years ago
We can prevent this by limiting the max size of the bitset (eg. to the number of QR codes collected from 10 minutes of use).
Where we put this limit is still a challenge -- it's not a limit that's related to the QRLib library, since a different platform may have different limititations. Passing in a parameter to Receive(...) may work. (that defaults to ~3000 if unspecified?)
ready for code review; changes are on the ticket-22 branch.
I did a bit of generic cleanup on this ticket, which may complicate review... The main change starts in Constants.java, where the max chunks limit is set -- following usage of that variable should bring up all the other semantic changes.
I also added/moved test cases to exercise the bug.
I've merged this with master, but the branch and ticket remain for code review.
Specifying the max chunks to the QR code generator, and limit checking against the generated chunks seems fine to me. approved with no comments.
Imported from trac #22.
When Receive reads a QR code with value for
totalChunks
that is fairly large, the !BitSet may fail to initialize with an !OutOfMemory error.To fix this, we'll likely need to do the following:
totalChunks
> largest capacity for phone.totalChunks
andchunkId
.