Merge pull request #2910 from Antiklesys/master

Fixed length check for snmp responses
This commit is contained in:
Iceman 2025-06-19 20:22:23 +02:00 committed by GitHub
commit f6aa71b10e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -238,7 +238,12 @@ static int sam_send_request_iso15(const uint8_t *const request, const uint8_t re
}
}
if (sam_rx_buf[6] == 0x81 && sam_rx_buf[8] == 0x8a && sam_rx_buf[9] == 0x81 ){ //check if the response is an SNMP message
*response_len = sam_rx_buf[5 + 2] + 3;
}else{ //if not, use the old logic
*response_len = sam_rx_buf[5 + 1] + 2;
}
memcpy(response, sam_rx_buf + 5, *response_len);
goto out;