1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

Fix MSP memory issue (#14221)

* fixes #14219

* Update src/main/msp/msp.c

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>

---------

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
This commit is contained in:
Jeff Haynes 2025-02-01 15:59:24 -05:00 committed by GitHub
parent 7cc8ee9a54
commit 79ecc1ac74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4147,7 +4147,7 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
}
const unsigned textLength = MIN(textSpace, sbufReadU8(src));
memset(textVar, 0, strlen(textVar));
textVar[textLength] = '\0';
sbufReadData(src, textVar, textLength);
#ifdef USE_OSD