Navigation



Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/messages.c

    r1539 r1549  
    19471947                }
    19481948               
     1949                /* Check the length is valid */
     1950                if ( avp->avp_public.avp_len < GETAVPHDRSZ(avp->avp_public.avp_flags) ) {
     1951                        TRACE_DEBUG(INFO, "Invalid AVP size %d",
     1952                                        avp->avp_public.avp_len);
     1953                        free(avp);
     1954                        return EBADMSG;
     1955                }
     1956
    19491957                /* Check there is enough remaining data in the buffer */
    19501958                if ( (avp->avp_public.avp_len > GETAVPHDRSZ(avp->avp_public.avp_flags))
     
    19922000                TRACE_DEBUG(INFO, "Truncated message (%zd / %d)", buflen, msglen );
    19932001                return EBADMSG;
     2002        }
     2003        if ( msglen < GETMSGHDRSZ() ) {
     2004                TRACE_DEBUG(INFO, "Invalid message length (%d)", msglen );
     2005                return EBADMSG;
    19942006        }
    19952007       
Note: See TracChangeset for help on using the changeset viewer.