Commit f616800
Isa
fix: prevent i8 overflow in chat packet fields (pending/checksum)
Fixes ERR_OUT_OF_RANGE crash when pending acknowledgment counter exceeds 127.
The messageCount, offset, and checksum fields in chat packets are serialized
as signed bytes (i8, range -128 to 127). The pending counter can exceed this
range on busy servers before the bot sends its first message.
This patch applies toSignedByte() conversion to:
- messageCount in chat_command/chat_command_signed packets
- offset in chat_message packets
- checksum in both (for 1.21.5+)
Fixes: PrismarineJS/mineflayer#3765
Related: PrismarineJS#14421 parent 75399c5 commit f616800
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
| |||
376 | 384 | | |
377 | 385 | | |
378 | 386 | | |
379 | | - | |
380 | | - | |
| 387 | + | |
| 388 | + | |
381 | 389 | | |
382 | 390 | | |
383 | 391 | | |
| |||
408 | 416 | | |
409 | 417 | | |
410 | 418 | | |
411 | | - | |
412 | | - | |
| 419 | + | |
| 420 | + | |
413 | 421 | | |
414 | 422 | | |
415 | 423 | | |
| |||
0 commit comments