mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-23 06:35:57 +00:00
snmp_v3: use strlen, not strnlen
strnlen is not portable. In this case, it does not matter as we zero-terminate the string before. Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
4413576494
commit
3bd84aba4b
|
@ -834,7 +834,7 @@ snmp_parse_inbound_frame(struct snmp_request *request)
|
||||||
/* @todo: Differentiate read/write access */
|
/* @todo: Differentiate read/write access */
|
||||||
strncpy((char *)request->community, snmp_community, SNMP_MAX_COMMUNITY_STR_LEN);
|
strncpy((char *)request->community, snmp_community, SNMP_MAX_COMMUNITY_STR_LEN);
|
||||||
request->community[SNMP_MAX_COMMUNITY_STR_LEN] = 0; /* ensure NULL termination (strncpy does NOT guarantee it!) */
|
request->community[SNMP_MAX_COMMUNITY_STR_LEN] = 0; /* ensure NULL termination (strncpy does NOT guarantee it!) */
|
||||||
request->community_strlen = (u16_t)strnlen((char *)request->community, SNMP_MAX_COMMUNITY_STR_LEN);
|
request->community_strlen = (u16_t)strlen((char *)request->community);
|
||||||
|
|
||||||
/* RFC3414 globalData */
|
/* RFC3414 globalData */
|
||||||
IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv));
|
IF_PARSE_EXEC(snmp_asn1_dec_tlv(&pbuf_stream, &tlv));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user