Thanks for the patch, we can definitely be more efficient here.
Can you give more info about the reasoning for the test case changes in commit 4288d755? Does this change pass the tests as they were originally written, or was the reasoning that these test cases are not representative of what should be tested?
Can you give more info about the reasoning for the test case changes
The old version of the tests didn't hit enough codepaths, since the protocol name was entirely unknown it would bail out early and never reach the part where it had to call .retain(). So now they test that it doesn't hang nearly forever.
So I don't think this is security-low, just slightly inefficient.
It creates a temporary Vec containing up to 4 billion integers, actually, in order to call .retain() on it. The updated tests try to use massive amounts of RAM without this change.
So I don't think this is security-low, just slightly inefficient.
It creates a temporary Vec containing up to 4 billion integers, actually, in order to call .retain() on it. The updated tests try to use massive amounts of RAM without this change.
Ah, thanks! That was the information I needed to know.