Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package belle-sip for openSUSE:Factory checked in at 2021-11-28 21:30:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/belle-sip (Old) and /work/SRC/openSUSE:Factory/.belle-sip.new.1895 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "belle-sip" Sun Nov 28 21:30:10 2021 rev:22 rq:934338 version:5.0.53 Changes: -------- --- /work/SRC/openSUSE:Factory/belle-sip/belle-sip.changes 2021-11-17 01:14:15.606172235 +0100 +++ /work/SRC/openSUSE:Factory/.belle-sip.new.1895/belle-sip.changes 2021-11-28 21:31:02.185898121 +0100 @@ -1,0 +2,7 @@ +Sun Nov 21 01:41:39 UTC 2021 - Giacomo Comes <gcomes....@gmail.com> - 5.0.53 + +- Update to version 5.0.53: + * Fix a crash when receiving parsing a rtcp-fb attribute with just + fb-id but no value + +------------------------------------------------------------------- Old: ---- belle-sip-5.0.49.tar.bz2 New: ---- belle-sip-5.0.53.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ belle-sip.spec ++++++ --- /var/tmp/diff_new_pack.B43X2n/_old 2021-11-28 21:31:02.669896574 +0100 +++ /var/tmp/diff_new_pack.B43X2n/_new 2021-11-28 21:31:02.669896574 +0100 @@ -20,7 +20,7 @@ %define soname libbellesip %define sover 1 Name: belle-sip -Version: 5.0.49 +Version: 5.0.53 Release: 0 Summary: C object-oriented SIP Stack License: GPL-2.0-or-later ++++++ belle-sip-5.0.49.tar.bz2 -> belle-sip-5.0.53.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/belle-sip-5.0.49/src/belle_sdp_impl.cc new/belle-sip-5.0.53/src/belle_sdp_impl.cc --- old/belle-sip-5.0.49/src/belle_sdp_impl.cc 2021-10-28 17:25:53.000000000 +0200 +++ new/belle-sip-5.0.53/src/belle_sdp_impl.cc 2021-11-11 00:42:01.000000000 +0100 @@ -58,7 +58,14 @@ }; static struct attribute_name_func_pair attribute_table[] = { { "rtcp-fb", (attribute_parse_func)belle_sdp_rtcp_fb_attribute_parse }, - { "rtcp-xr", (attribute_parse_func)belle_sdp_rtcp_xr_attribute_parse } + { "rtcp-xr", (attribute_parse_func)belle_sdp_rtcp_xr_attribute_parse }, + { "creq", (attribute_parse_func)belle_sdp_creq_attribute_parse }, + { "csup", (attribute_parse_func)belle_sdp_csup_attribute_parse }, + { "tcap", (attribute_parse_func)belle_sdp_tcap_attribute_parse }, + { "acap", (attribute_parse_func)belle_sdp_acap_attribute_parse }, + { "csup", (attribute_parse_func)belle_sdp_csup_attribute_parse }, + { "acfg", (attribute_parse_func)belle_sdp_acfg_attribute_parse }, + { "pcfg", (attribute_parse_func)belle_sdp_pcfg_attribute_parse } }; struct _belle_sdp_attribute { belle_sip_object_t base; @@ -1070,7 +1077,30 @@ belle_sdp_raw_attribute_set_value(attribute,value); base_description->attributes = belle_sip_list_append(base_description->attributes,belle_sip_object_ref(attribute)); } + +#define SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute_ptr, attribute_name, attribute_type)\ + (strcmp((attribute_ptr)->name, attribute_name) == 0 && !BELLE_SIP_IS_INSTANCE_OF(attribute_ptr, attribute_type)) + + void belle_sdp_base_description_add_attribute(belle_sdp_base_description_t* base_description, belle_sdp_attribute_t* attribute) { + /* Sanity check to avoid specialized attributes to be parsed as raw attribute as a fallback. + * The application code will be confused not to be able to cast the attribute in its specialized type. + */ + if (SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "rtcp-fb", belle_sdp_rtcp_fb_attribute_t) + || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "rtcp-xr", belle_sdp_rtcp_xr_attribute_t) + || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "creq", belle_sdp_creq_attribute_t) + || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "csup", belle_sdp_csup_attribute_t) + || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "tcap", belle_sdp_tcap_attribute_t) + || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "acap", belle_sdp_acap_attribute_t) + || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "csup", belle_sdp_csup_attribute_t) + || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "acfg", belle_sdp_acfg_attribute_t) + || SPECIALIZED_ATTRIBUTE_HAS_INCORRECT_TYPE(attribute, "pcfg", belle_sdp_pcfg_attribute_t) + ){ + belle_sip_error("Erroneously parsed attribute with name [%s] and value [%s], skipped", + belle_sdp_attribute_get_name(attribute), belle_sdp_attribute_get_value(attribute)); + belle_sip_object_unref(attribute); + return; + } base_description->attributes = belle_sip_list_append(base_description->attributes,(void*)belle_sip_object_ref(BELLE_SIP_OBJECT(attribute))); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/belle-sip-5.0.49/src/sdp/sdp.txt new/belle-sip-5.0.53/src/sdp/sdp.txt --- old/belle-sip-5.0.49/src/sdp/sdp.txt 2021-10-28 17:25:53.000000000 +0200 +++ new/belle-sip-5.0.53/src/sdp/sdp.txt 2021-11-11 00:42:01.000000000 +0100 @@ -339,6 +339,7 @@ / rtcp-fb-trr-int-type SP rtcp-fb-trr-int / rtcp-fb-ccm-type SP rtcp-fb-ccm-param / rtcp-fb-id rtcp-fb-param + / rtcp-fb-id ;no or empty param rtcp-fb-trr-int-type = "trr-int" rtcp-fb-trr-int = 1*DIGIT @@ -358,7 +359,6 @@ rtcp-fb-param = SP "app" [SP byte-string] / SP token [SP byte-string] / rtcp-fb-trr-int - / text; empty rtcp-fb-ack-type = "ack" rtcp-fb-ack-param = SP "rpsi" Binary files old/belle-sip-5.0.49/src/sdp/sdp_grammar and new/belle-sip-5.0.53/src/sdp/sdp_grammar differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/belle-sip-5.0.49/tester/belle_sdp_tester.c new/belle-sip-5.0.53/tester/belle_sdp_tester.c --- old/belle-sip-5.0.49/tester/belle_sdp_tester.c 2021-10-28 17:25:53.000000000 +0200 +++ new/belle-sip-5.0.53/tester/belle_sdp_tester.c 2021-11-11 00:42:01.000000000 +0100 @@ -885,6 +885,30 @@ return; } +static const char* sdp_with_invalid_rtcp_fb = "v=0\r\n"\ + "o=jehan-mac 1239 1239 IN IP6 2a01:e35:1387:1020:6233:4bff:fe0b:5663\r\n"\ + "s=SIP Talk\r\n"\ + "c=IN IP4 192.168.0.18\r\n"\ + "b=AS:380\r\n"\ + "t=0 0\r\n"\ + "a=ice-pwd:31ec21eb38b2ec6d36e8dc7b\r\n"\ + "m=audio 7078 RTP/AVP 111 110 3 0 8 101\r\n"\ + "a=rtcp-fb\r\n"\ + "a=rtpmap:111 speex/16000\r\n"; + +static void test_session_description_with_invalid_rtcp_fb(void) { + const char* l_src = sdp_with_invalid_rtcp_fb; + belle_sip_list_t* media_descriptions; + belle_sdp_media_description_t *media_description; + belle_sdp_session_description_t* l_session_description = belle_sdp_session_description_parse(l_src); + /* make sure that the invalid rtcp-fb is not parsed as a raw attribute. */ + media_descriptions = belle_sdp_session_description_get_media_descriptions(l_session_description); + media_description = (belle_sdp_media_description_t*) media_descriptions->data; + BC_ASSERT_PTR_NULL(belle_sdp_media_description_get_attribute(media_description, "rtcp-fb")); + belle_sip_object_unref(l_session_description); +} + + static void test_overflow(void){ belle_sdp_session_description_t* sdp; belle_sip_list_t *mds; @@ -1065,7 +1089,8 @@ TEST_NO_TAG("Session description with capability reference before definition", test_session_description_with_capability_referenced_before_definition), TEST_NO_TAG("Session description", test_session_description), TEST_NO_TAG("Session description for fax", test_image_mline), - TEST_NO_TAG("Marshal buffer overflow", test_overflow) + TEST_NO_TAG("Marshal buffer overflow", test_overflow), + TEST_NO_TAG("Invalid specialized attribute not parsed as raw attribute", test_session_description_with_invalid_rtcp_fb) }; test_suite_t sdp_test_suite = {"SDP", NULL, NULL, belle_sip_tester_before_each, belle_sip_tester_after_each,