Mercurial > hg > freeDiameter
comparison libfdproto/messages.c @ 752:9e9840ccf059
Attempt to handle more gracefully (invalid) AVPs that contain an empty octetstring
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Sat, 24 Sep 2011 09:45:14 +0200 |
parents | 4a9f08d6b6ba |
children | 71833fa5e35f |
comparison
equal
deleted
inserted
replaced
751:c7d9c5477d2f | 752:9e9840ccf059 |
---|---|
1768 error_info->pei_avp = avp; | 1768 error_info->pei_avp = avp; |
1769 } | 1769 } |
1770 return EBADMSG; | 1770 return EBADMSG; |
1771 } ); | 1771 } ); |
1772 avp->avp_storage.os.len = avp->avp_public.avp_len - GETAVPHDRSZ( avp->avp_public.avp_flags ); | 1772 avp->avp_storage.os.len = avp->avp_public.avp_len - GETAVPHDRSZ( avp->avp_public.avp_flags ); |
1773 if (avp->avp_storage.os.len) { | 1773 CHECK_MALLOC( avp->avp_storage.os.data = os0dup(avp->avp_source, avp->avp_storage.os.len) ); |
1774 CHECK_MALLOC( avp->avp_storage.os.data = os0dup(avp->avp_source, avp->avp_storage.os.len) ); | 1774 avp->avp_mustfreeos = 1; |
1775 avp->avp_mustfreeos = 1; | |
1776 } else { | |
1777 avp->avp_storage.os.data = NULL; | |
1778 } | |
1779 break; | 1775 break; |
1780 | 1776 |
1781 case AVP_TYPE_INTEGER32: | 1777 case AVP_TYPE_INTEGER32: |
1782 avp->avp_storage.i32 = (int32_t)ntohl(*(uint32_t *)avp->avp_source); | 1778 avp->avp_storage.i32 = (int32_t)ntohl(*(uint32_t *)avp->avp_source); |
1783 break; | 1779 break; |