Mercurial > hg > freeDiameter
diff libfdproto/messages.c @ 1562:6219359a36a9 default tip
Merge latest changes from proposed branch
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Mon, 21 Jun 2021 19:08:18 +0800 |
parents | 2dbc816d48f4 |
children |
line wrap: on
line diff
--- a/libfdproto/messages.c Sat Oct 10 12:58:37 2020 +0800 +++ b/libfdproto/messages.c Mon Jun 21 19:08:18 2021 +0800 @@ -1776,13 +1776,13 @@ if (avp->avp_model == NULL) { /* In the case where we don't know the type of AVP, just copy the raw data or source */ - CHECK_PARAMS( avp->avp_source || avp->avp_rawdata ); + /* there might be no data if the AVP is empty */ if ( avp->avp_rawdata != NULL ) { /* the content was stored in rawdata */ memcpy(&buffer[*offset], avp->avp_rawdata, avp->avp_rawlen); *offset += PAD4(avp->avp_rawlen); - } else { + } else if ( avp->avp_source != NULL ) { /* the message was not parsed completely */ size_t datalen = avp->avp_public.avp_len - GETAVPHDRSZ(avp->avp_public.avp_flags); memcpy(&buffer[*offset], avp->avp_source, datalen);