Commit 6995742b authored by aymeric's avatar aymeric

fix parsing of error-code

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@285 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 3385930e
......@@ -177,7 +177,7 @@ stunParseAtrChangeRequest( char* body, unsigned int hdrLen, StunAtrChangeReques
static bool_t
stunParseAtrError( char* body, unsigned int hdrLen, StunAtrError *result )
{
if ( hdrLen >= sizeof(StunAtrError) )
if ( hdrLen < 4 || hdrLen >= 128+4)
{
ortp_error("stun: Incorrect size for SA_ERRORCODE");
return FALSE;
......@@ -845,7 +845,7 @@ static char*
encodeAtrError(char* ptr, const StunAtrError *atr)
{
ptr = encode16(ptr, SA_ERRORCODE);
ptr = encode16(ptr, 6 + atr->sizeReason);
ptr = encode16(ptr, 4 + atr->sizeReason);
ptr = encode16(ptr, atr->pad);
*ptr++ = atr->errorClass;
*ptr++ = atr->number;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment