Skip to content

Commit 81f0e3a

Browse files
committed
Fix uninitialised buffers on arming screens
Fixes #10506 buf2 and craftNameBuf were not initialised. But, could have been used. Both are now initialised before use.
1 parent a25df70 commit 81f0e3a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/io/osd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5346,11 +5346,13 @@ static void osdShowHDArmScreen(void)
53465346
armScreenRow = drawLogos(false, armScreenRow);
53475347
armScreenRow++;
53485348

5349+
memset(buf2, '\0', sizeof(buf2));
53495350
if (!osdConfig()->use_pilot_logo && osdElementEnabled(OSD_PILOT_NAME, false) && strlen(systemConfig()->pilotName) > 0) {
53505351
osdFormatPilotName(buf2);
53515352
showPilotOrCraftName = true;
53525353
}
53535354

5355+
memset(craftNameBuf, '\0', sizeof(craftNameBuf));
53545356
if (osdElementEnabled(OSD_CRAFT_NAME, false) && strlen(systemConfig()->craftName) > 0) {
53555357
osdFormatCraftName(craftNameBuf);
53565358
if (strlen(buf2) > 0) {
@@ -5486,11 +5488,13 @@ static void osdShowSDArmScreen(void)
54865488
#endif
54875489
#endif
54885490

5491+
memset(buf2, '\0', sizeof(buf2));
54895492
if (osdElementEnabled(OSD_PILOT_NAME, false) && strlen(systemConfig()->pilotName) > 0) {
54905493
osdFormatPilotName(buf2);
54915494
showPilotOrCraftName = true;
54925495
}
54935496

5497+
memset(craftNameBuf, '\0', sizeof(craftNameBuf));
54945498
if (osdElementEnabled(OSD_CRAFT_NAME, false) && strlen(systemConfig()->craftName) > 0) {
54955499
osdFormatCraftName(craftNameBuf);
54965500
if (strlen(buf2) > 0) {

0 commit comments

Comments
 (0)