Maybe, honestly I do not remember the details as it was done a few months ago. It would require me to dive in once I have the time (so not now).
Could you please either explain why I'm wrong, or else revert commit dd15b2?
But is you can come up with a better solution that ensures that we do not have the infinite loop while still being correct, you are welcome and I will try to review it
Without even looking at the capture from bug 15856, I can see an infinite loop when subtype = MESSAGE_SUB_PAD1 and sublen = 0:
if(subtype == MESSAGE_SUB_PAD1){
beg += sublen;
continue;
}
Maybe the test for sublen value should be put only when the
subtype is MESSAGE_SUB_PAD1? Or when subtype is different from MESSAGE_SUB_PADN?
As you seem to know this protocol, your feedback is welcome.
Best regards,
Pascal.