]> git.pld-linux.org Git - packages/pjproject.git/blame - 0001-r5397-pjsip_generic_array_max_count.patch
Patches and config_site.h updates from Asterisk 13.12
[packages/pjproject.git] / 0001-r5397-pjsip_generic_array_max_count.patch
CommitLineData
14efab78
JK
1This patch updates array limit checks and docs
2in pjsip_evsub_register_pkg() and pjsip_endpt_add_capability().
3
4Index: pjsip/include/pjsip/sip_endpoint.h
5===================================================================
6--- a/pjsip/include/pjsip/sip_endpoint.h (revision 5396)
7+++ b/pjsip/include/pjsip/sip_endpoint.h (revision 5397)
8@@ -583,7 +583,8 @@
9 * @param hname If htype specifies PJSIP_H_OTHER, then the header name
10 * must be supplied in this argument. Otherwise the value
11 * must be set to NULL.
12- * @param count The number of tags in the array.
13+ * @param count The number of tags in the array. The value must not
14+ * be greater than PJSIP_GENERIC_ARRAY_MAX_COUNT.
15 * @param tags Array of tags describing the capabilities or extensions
16 * to be added to the appropriate header.
17 *
18Index: pjsip/include/pjsip-simple/evsub.h
19===================================================================
20--- a/pjsip/include/pjsip-simple/evsub.h (revision 5396)
21+++ b/pjsip/include/pjsip-simple/evsub.h (revision 5397)
22@@ -246,7 +246,8 @@
23 * registered.
24 * @param event_name Event package identification.
25 * @param expires Default subscription expiration time, in seconds.
26- * @param accept_cnt Number of strings in Accept array.
27+ * @param accept_cnt Number of strings in Accept array. The value must
28+ * not be greater than PJSIP_GENERIC_ARRAY_MAX_COUNT.
29 * @param accept Array of Accept value.
30 *
31 * @return PJ_SUCCESS on success.
32Index: pjsip/src/pjsip/sip_endpoint.c
33===================================================================
34--- a/pjsip/src/pjsip/sip_endpoint.c (revision 5396)
35+++ b/pjsip/src/pjsip/sip_endpoint.c (revision 5397)
36@@ -371,6 +371,7 @@
37
38 /* Check arguments. */
39 PJ_ASSERT_RETURN(endpt!=NULL && count>0 && tags, PJ_EINVAL);
40+ PJ_ASSERT_RETURN(count <= PJSIP_GENERIC_ARRAY_MAX_COUNT, PJ_ETOOMANY);
41 PJ_ASSERT_RETURN(htype==PJSIP_H_ACCEPT ||
42 htype==PJSIP_H_ALLOW ||
43 htype==PJSIP_H_SUPPORTED,
44Index: pjsip/src/pjsip-simple/evsub.c
45===================================================================
46--- a/pjsip/src/pjsip-simple/evsub.c (revision 5396)
47+++ b/pjsip/src/pjsip-simple/evsub.c (revision 5397)
48@@ -412,7 +412,9 @@
49 unsigned i;
50
51 PJ_ASSERT_RETURN(pkg_mod && event_name, PJ_EINVAL);
52- PJ_ASSERT_RETURN(accept_cnt < PJ_ARRAY_SIZE(pkg->pkg_accept->values),
53+
54+ /* Make sure accept_cnt < PJ_ARRAY_SIZE(pkg->pkg_accept->values) */
55+ PJ_ASSERT_RETURN(accept_cnt <= PJSIP_GENERIC_ARRAY_MAX_COUNT,
56 PJ_ETOOMANY);
57
58 /* Make sure evsub module has been initialized */
This page took 0.084777 seconds and 4 git commands to generate.