Changeset 5397


Ignore:
Timestamp:
Jul 26, 2016 2:58:44 AM (3 years ago)
Author:
nanang
Message:

Misc (re #1945): Updated array limit checks and docs in pjsip_evsub_register_pkg() and pjsip_endpt_add_capability(). Thanks Alexei Gradinari for the patch.

Location:
pjproject/trunk/pjsip
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip-simple/evsub.h

    r5351 r5397  
    247247 * @param event_name    Event package identification. 
    248248 * @param expires       Default subscription expiration time, in seconds. 
    249  * @param accept_cnt    Number of strings in Accept array. 
     249 * @param accept_cnt    Number of strings in Accept array. The value must 
     250 *                      not be greater than PJSIP_GENERIC_ARRAY_MAX_COUNT. 
    250251 * @param accept        Array of Accept value. 
    251252 * 
  • pjproject/trunk/pjsip/include/pjsip/sip_endpoint.h

    r5055 r5397  
    584584 *                  must be supplied in this argument. Otherwise the value 
    585585 *                  must be set to NULL. 
    586  * @param count     The number of tags in the array. 
     586 * @param count     The number of tags in the array. The value must not 
     587 *                  be greater than PJSIP_GENERIC_ARRAY_MAX_COUNT. 
    587588 * @param tags      Array of tags describing the capabilities or extensions 
    588589 *                  to be added to the appropriate header. 
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub.c

    r5351 r5397  
    413413 
    414414    PJ_ASSERT_RETURN(pkg_mod && event_name, PJ_EINVAL); 
    415     PJ_ASSERT_RETURN(accept_cnt < PJ_ARRAY_SIZE(pkg->pkg_accept->values),  
     415     
     416    /* Make sure accept_cnt < PJ_ARRAY_SIZE(pkg->pkg_accept->values) */ 
     417    PJ_ASSERT_RETURN(accept_cnt <= PJSIP_GENERIC_ARRAY_MAX_COUNT,  
    416418                     PJ_ETOOMANY); 
    417419 
  • pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c

    r5055 r5397  
    372372    /* Check arguments. */ 
    373373    PJ_ASSERT_RETURN(endpt!=NULL && count>0 && tags, PJ_EINVAL); 
     374    PJ_ASSERT_RETURN(count <= PJSIP_GENERIC_ARRAY_MAX_COUNT, PJ_ETOOMANY); 
    374375    PJ_ASSERT_RETURN(htype==PJSIP_H_ACCEPT ||  
    375376                     htype==PJSIP_H_ALLOW || 
Note: See TracChangeset for help on using the changeset viewer.