Skip to content

Commit 078cb8b

Browse files
author
dingo35
committed
evse.h, meter.cpp: nullterminate APpassword
1 parent 7eb0e94 commit 078cb8b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

SmartEVSE-3/include/evse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ struct Sensorbox {
596596
uint8_t WiFiAPSTA; // 0:no portal / 1: portal active
597597
uint8_t WIFImode; // 0:Wifi Off / 1:WiFi On / 2: Portal Start
598598
uint8_t IP[4];
599-
uint8_t APpassword[8];
599+
uint8_t APpassword[9]; // 8 characters + null termination
600600
};
601601

602602
#define EPOCH2_OFFSET 1672531200

SmartEVSE-3/src/meter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ uint8_t Meter::receiveCurrentMeasurement(uint8_t *buf) {
198198
for (x = 0; x < 8; x++) {
199199
SB2.APpassword[7-x] = buf[56 + x];
200200
}
201+
SB2.APpassword[8] = '\0';
201202

202203
if (SB2_WIFImode == 2 && SB2.WiFiConnected && !SubMenu) {
203204
SB2_WIFImode = 1; // Portal active and connected? Switch back to Enabled.

0 commit comments

Comments
 (0)