first buffer overflow
This commit is contained in:
@@ -62,7 +62,7 @@ static err_t modbus_incoming_data(void* arg, struct tcp_pcb* pcb, struct pbuf* p
|
|||||||
tcp_recved(pcb, p->tot_len);
|
tcp_recved(pcb, p->tot_len);
|
||||||
pc = (char*)p->payload;
|
pc = (char*)p->payload;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < MAX_REG; i++) { // Putting the buffer in the register array
|
for (uint16_t i = 0; i < p->tot_len && i < MAX_REG; i++) { // Putting the buffer in the register array
|
||||||
registers[i] = pc[i]; // Getting the error "void value not ignored as it ought to be" on this line
|
registers[i] = pc[i]; // Getting the error "void value not ignored as it ought to be" on this line
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user