Added some error checking.
FossilOrigin-Name: 7583b428afd42091129e4c2a588b23012f972f42e2be0c3fe3968c4172aaca4d
This commit is contained in:
parent
c5d4aa9cdd
commit
ca0e8255ea
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user