-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[client] Fix #19351 - vFillBuffer
fix uint16 summation overflow.
#19540
Conversation
acb077e
to
946776c
Compare
PR #19540: Size comparison from 3605ef9 to 946776c Increases (5 builds for k32w, linux, nrfconnect, telink)
Decreases (3 builds for esp32, telink)
Full report (36 builds for cc13x2_26x2, cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
PR #19540: Size comparison from 3605ef9 to 98dfe03 Increases (41 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Decreases (5 builds for cc13x2_26x2)
Full report (41 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
vFillBuffer
fix uint16 summation overflow. NCC-E003350-HRX
vFillBuffer
fix uint16 summation overflow. NCC-E003350-HRXvFillBuffer
fix uint16 summation overflow.
@@ -210,7 +210,8 @@ static uint16_t vFillBuffer(uint8_t * buffer, uint16_t bufferLen, uint8_t frameC | |||
// The destination buffer must be at least as large as the running total | |||
// plus the length of the integer value (if applicable) plus the length of | |||
// the data (if applicable). | |||
if (bufferLen < bytes + dataLen + valueLen) | |||
// Fix #19351 - Cast up to larger type during summation to prevent integer overflow issues. | |||
if (bufferLen < (uint32_t) bytes + (uint32_t) dataLen + (uint32_t) valueLen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but we should make #19291 compile and merge it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merged and updated #19291 a bit, hoping to be able to push that instead soon. So far blocked in CI queue
client-api.cpp was removed alltogether |
Problem
Fix #19351
NCC-E003350-HRX
uint16 overflow issue in
vFillBuffer()
flagged by security audit.Change overview
suggested fix
Testing
CI