Navigation


Changeset 1559:2dbc816d48f4 in freeDiameter for libfdproto


Ignore:
Timestamp:
Oct 27, 2020, 6:50:04 PM (3 years ago)
Author:
Thomas Klausner <wiz@gatalith.at>
Branch:
default
Phase:
public
Message:

Fail when a peer with empty Origin-Realm tries to connect.

Empty Origin-Realms cause problems in the routing code later.

Reduce warnings when reporting an empty Failed-AVP;
both avp_source and avp_rawdata are NULL in this case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdproto/messages.c

    r1554 r1559  
    17771777        if (avp->avp_model == NULL) {
    17781778                /* In the case where we don't know the type of AVP, just copy the raw data or source */
    1779                 CHECK_PARAMS( avp->avp_source || avp->avp_rawdata );
     1779                /* there might be no data if the AVP is empty */
    17801780               
    17811781                if ( avp->avp_rawdata != NULL ) {
     
    17831783                        memcpy(&buffer[*offset], avp->avp_rawdata, avp->avp_rawlen);
    17841784                        *offset += PAD4(avp->avp_rawlen);
    1785                 } else {
     1785                } else if ( avp->avp_source != NULL ) {
    17861786                        /* the message was not parsed completely */
    17871787                        size_t datalen = avp->avp_public.avp_len - GETAVPHDRSZ(avp->avp_public.avp_flags);
Note: See TracChangeset for help on using the changeset viewer.