mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-28 09:19:53 +00:00
snmp_traps.c: Fix compile on Win32 - missing string.h include
Catch possible strlen returnvalue > 0xffff
This commit is contained in:
parent
799fe7a5ba
commit
6650eb4cd2
@ -35,6 +35,8 @@
|
||||
|
||||
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "lwip/snmp.h"
|
||||
#include "lwip/sys.h"
|
||||
#include "lwip/apps/snmp.h"
|
||||
@ -272,7 +274,7 @@ snmp_trap_header_sum(struct snmp_msg_trap *trap)
|
||||
snmp_asn1_enc_length_cnt(trap->pdulen, &lenlen);
|
||||
tot_len += 1 + lenlen;
|
||||
|
||||
trap->comlen = (u16_t)strlen(snmp_community_trap);
|
||||
trap->comlen = (u16_t)LWIP_MIN(strlen(snmp_community_trap), 0xFFFF);
|
||||
snmp_asn1_enc_length_cnt(trap->comlen, &lenlen);
|
||||
tot_len += 1 + lenlen + trap->comlen;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user