diff --git a/src/capwap/cw_readelem_ac_name.c b/src/capwap/cw_readelem_ac_name.c index ebd2941b..d11b1d6f 100644 --- a/src/capwap/cw_readelem_ac_name.c +++ b/src/capwap/cw_readelem_ac_name.c @@ -19,11 +19,19 @@ #include "capwap.h" #include "cw_util.h" +#include "cw_log.h" int cw_readelem_ac_name(uint8_t **dst, int type,uint8_t *msgelem, int len) { if (type != CWMSGELEM_AC_NAME) return 0; + + if (len > 512 ) { + cw_dbg(DBG_CW_RFC,"AC name too long, max. 512 bytes allowed (RFC 5415)"); + cw_dbg(DBG_CW_MSG_ERR,"AC name truncated to 512 bytes"); + len = 512; + } + cw_setstr(dst,msgelem,len); return 1; }