git:5.0:bcf6cb0d: sca: fix core when release_appearance RPC command parameter has wrong index

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

git:5.0:bcf6cb0d: sca: fix core when release_appearance RPC command parameter has wrong index

Victor Seva
Module: kamailio
Branch: 5.0
Commit: bcf6cb0d22e851ce2a42427f1269718dca8dacae
URL: https://github.com/kamailio/kamailio/commit/bcf6cb0d22e851ce2a42427f1269718dca8dacae

Author: Victor Seva <[hidden email]>
Committer: Victor Seva <[hidden email]>
Date: 2017-06-08T13:46:52+02:00

sca: fix core when release_appearance RPC command parameter has wrong index

> #0  0x00007fd8bba5a067 in raise () from /lib/x86_64-linux-gnu/libc.so.6
> #1  0x00007fd8bba5b448 in abort () from /lib/x86_64-linux-gnu/libc.so.6
> #2  0x00007fd8bba53266 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
> #3  0x00007fd8bba53312 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
> #4  0x00007fd8a4b16328 in sca_appearance_list_unlink_index (app_list=0x7fd8a603c528, idx=0) at sca_appearance.c:254
> #5  0x00007fd8a4ae0372 in sca_rpc_release_appearance (rpc=0x7fd8b1162300 <binrpc_callbacks>, ctx=0x7ffc2ce9eef0) at sca_rpc.c:504
> #6  0x00007fd8b0f38abb in process_rpc_req (buf=0x1e5e744 "\241\003\067oZ\274Ƒ\027sca.release_appearance", size=12344, bytes_needed=0x7ffc2ce9effc, sh=0xfefefefefefefe00,
>    saved_state=0xfefefefefefefe00) at binrpc_run.c:675

(cherry picked from commit 68045ff55f8e9972d0560ae0216b0fe1f28556d6)

---

Modified: src/modules/sca/sca_rpc.c

---

Diff:  https://github.com/kamailio/kamailio/commit/bcf6cb0d22e851ce2a42427f1269718dca8dacae.diff
Patch: https://github.com/kamailio/kamailio/commit/bcf6cb0d22e851ce2a42427f1269718dca8dacae.patch

---

diff --git a/src/modules/sca/sca_rpc.c b/src/modules/sca/sca_rpc.c
index 8edc572bac..6005aea3a8 100644
--- a/src/modules/sca/sca_rpc.c
+++ b/src/modules/sca/sca_rpc.c
@@ -483,6 +483,11 @@ void sca_rpc_release_appearance(rpc_t *rpc, void *ctx)
  return;
  }
 
+ if (app_idx <= 0) {
+ rpc->fault(ctx, 500, "appearance-index must be > 0");
+ return;
+ }
+
  if ((ht = sca->appearances) == NULL) {
  rpc->fault(ctx, 500, "No active appearances");
  return;



_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Loading...