Skip to content

packSendPayload() improved (fixed off-by-one error)#70

Open
inobelar wants to merge 1 commit intoSolidGeek:masterfrom
inobelar:patch-1
Open

packSendPayload() improved (fixed off-by-one error)#70
inobelar wants to merge 1 commit intoSolidGeek:masterfrom
inobelar:patch-1

Conversation

@inobelar
Copy link
Copy Markdown

The main reason of packSendPayload() complete clarification & safety improvements is off-by-one error here:

if (lenPay <= 256)

It must be lenPay <= 255 (since uint8_t::max is 255, and we cannot store 256 in single byte).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant