Skip to content

Commit db7baa7

Browse files
committed
* CommonCLI: bounds check added to "unknown config:" replies
1 parent dee3e26 commit db7baa7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/helpers/CommonCLI.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "CommonCLI.h"
33
#include "TxtDataHelpers.h"
44
#include "AdvertDataHelpers.h"
5+
#include "TxtDataHelpers.h"
56
#include <RTClib.h>
67

78
#ifndef BRIDGE_MAX_BAUD
@@ -726,7 +727,8 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
726727
strcpy(reply, "Error: unsupported by this board");
727728
};
728729
} else {
729-
sprintf(reply, "unknown config: %s", config);
730+
strcpy(reply, "unknown config: ");
731+
StrHelper::strncpy(&reply[16], config, 160-17);
730732
}
731733
}
732734

0 commit comments

Comments
 (0)