[Asterisk-code-review] pjproject: fixed a few bugs (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Thu Jul 21 10:41:22 CDT 2016


Alexei Gradinari has uploaded a new change for review.

  https://gerrit.asterisk.org/3278

Change subject: pjproject: fixed a few bugs
......................................................................

pjproject: fixed a few bugs

This patch fixed the issue when tx_data_destroy can be called more than once.
The tx_data_destroy has to be called only once when ref_cnt is zero.

This patch removed usage of uninitialized variable.
The code of the function 'pjsip_evsub_register_pkg' uses
in an assert a variable 'pkg' that has not been initialized.
This patch removes this assert because it's not possible to
check an array size of a parameter 'accept'.

Change-Id: I4c7a132b9664afaecbd6bf5ea4c951e43e273e40
---
A third-party/pjproject/patches/0001-pjsip-simple-evsub-uninitialized-variable.patch
A third-party/pjproject/patches/0001-pjsip_tx_data_dec_ref.patch
2 files changed, 26 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/78/3278/1

diff --git a/third-party/pjproject/patches/0001-pjsip-simple-evsub-uninitialized-variable.patch b/third-party/pjproject/patches/0001-pjsip-simple-evsub-uninitialized-variable.patch
new file mode 100644
index 0000000..d3cb97f
--- /dev/null
+++ b/third-party/pjproject/patches/0001-pjsip-simple-evsub-uninitialized-variable.patch
@@ -0,0 +1,13 @@
+Index: pjsip/src/pjsip-simple/evsub.c
+===================================================================
+--- a/pjsip/src/pjsip-simple/evsub.c	(revision 5389)
++++ b/pjsip/src/pjsip-simple/evsub.c	(working copy)
+@@ -412,8 +412,6 @@
+     unsigned i;
+ 
+     PJ_ASSERT_RETURN(pkg_mod && event_name, PJ_EINVAL);
+-    PJ_ASSERT_RETURN(accept_cnt < PJ_ARRAY_SIZE(pkg->pkg_accept->values), 
+-		     PJ_ETOOMANY);
+ 
+     /* Make sure evsub module has been initialized */
+     PJ_ASSERT_RETURN(mod_evsub.mod.id != -1, PJ_EINVALIDOP);
diff --git a/third-party/pjproject/patches/0001-pjsip_tx_data_dec_ref.patch b/third-party/pjproject/patches/0001-pjsip_tx_data_dec_ref.patch
new file mode 100644
index 0000000..8e6ca6e
--- /dev/null
+++ b/third-party/pjproject/patches/0001-pjsip_tx_data_dec_ref.patch
@@ -0,0 +1,13 @@
+Index: pjsip/src/pjsip/sip_transport.c
+===================================================================
+--- a/pjsip/src/pjsip/sip_transport.c	(revision 5389)
++++ b/pjsip/src/pjsip/sip_transport.c	(working copy)
+@@ -492,7 +492,7 @@
+ PJ_DEF(pj_status_t) pjsip_tx_data_dec_ref( pjsip_tx_data *tdata )
+ {
+     pj_assert( pj_atomic_get(tdata->ref_cnt) > 0);
+-    if (pj_atomic_dec_and_get(tdata->ref_cnt) <= 0) {
++    if (pj_atomic_dec_and_get(tdata->ref_cnt) == 0) {
+ 	tx_data_destroy(tdata);
+ 	return PJSIP_EBUFDESTROYED;
+     } else {

-- 
To view, visit https://gerrit.asterisk.org/3278
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c7a132b9664afaecbd6bf5ea4c951e43e273e40
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>



More information about the asterisk-code-review mailing list