Skip to content

Commit b998bf3

Browse files
Fix buffer overflow in leadscout hq receive code
The variable block is a 128-byte buffer, but Scout.wifi.client.read was passed a buffer size of 256, potentially making it overflow the buffer. This makes the code use sizeof, so the size passed is always correct.
1 parent 83a7b7b commit b998bf3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ScoutHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void leadHQHandle(void) {
252252
}
253253

254254
// get all waiting data and look for packets
255-
while(rsize = Scout.wifi.client.read(block, 256)){
255+
while(rsize = Scout.wifi.client.read(block, sizeof(block))){
256256
len = strlen(buffer);
257257

258258
// process chunk of incoming data

0 commit comments

Comments
 (0)