Re #1882 (misc): Fixed inaccurate index checking assertion when removing SDP attributes in pjmedia_sdp_attr_remove() and pjmedia_sdp_attr_remove_all()
Thanks to Fredrik Hansson for the report. git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5192 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
ed308eb03f
commit
7416bdc608
|
@ -201,7 +201,7 @@ PJ_DEF(unsigned) pjmedia_sdp_attr_remove_all(unsigned *count,
|
||||||
pj_str_t attr_name;
|
pj_str_t attr_name;
|
||||||
|
|
||||||
PJ_ASSERT_RETURN(count && attr_array && name, PJ_EINVAL);
|
PJ_ASSERT_RETURN(count && attr_array && name, PJ_EINVAL);
|
||||||
PJ_ASSERT_RETURN(*count < PJMEDIA_MAX_SDP_ATTR, PJ_ETOOMANY);
|
PJ_ASSERT_RETURN(*count <= PJMEDIA_MAX_SDP_ATTR, PJ_ETOOMANY);
|
||||||
|
|
||||||
attr_name.ptr = (char*)name;
|
attr_name.ptr = (char*)name;
|
||||||
attr_name.slen = pj_ansi_strlen(name);
|
attr_name.slen = pj_ansi_strlen(name);
|
||||||
|
@ -228,7 +228,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_attr_remove( unsigned *count,
|
||||||
unsigned i, removed=0;
|
unsigned i, removed=0;
|
||||||
|
|
||||||
PJ_ASSERT_RETURN(count && attr_array && attr, PJ_EINVAL);
|
PJ_ASSERT_RETURN(count && attr_array && attr, PJ_EINVAL);
|
||||||
PJ_ASSERT_RETURN(*count < PJMEDIA_MAX_SDP_ATTR, PJ_ETOOMANY);
|
PJ_ASSERT_RETURN(*count <= PJMEDIA_MAX_SDP_ATTR, PJ_ETOOMANY);
|
||||||
|
|
||||||
for (i=0; i<*count; ) {
|
for (i=0; i<*count; ) {
|
||||||
if (attr_array[i] == attr) {
|
if (attr_array[i] == attr) {
|
||||||
|
|
Loading…
Reference in New Issue