A 2GB+ packet is likely to be a mistake, but in the event it was
legitimate sign extension could result in a much larger amount of
memory being allocated (and probably failing). Fix this by trying
to ensure we're doing an unsigned left shift.
break;
}
curpacket->packet->length =
break;
}
curpacket->packet->length =
+ ((unsigned) curchar << 24);
if (getchar_func(ctx, 1, &curchar)) {
rc = ONAK_E_INVALID_PKT;
break;
if (getchar_func(ctx, 1, &curchar)) {
rc = ONAK_E_INVALID_PKT;
break;