Module: kamailio
Branch: 5.1
Commit: a6480c2b8f63ed02aebc13152b8c36149acaf92b
URL:
https://github.com/kamailio/kamailio/commit/a6480c2b8f63ed02aebc13152b8c361…
Author: Seudin Kasumovic <seudin.kasumovic(a)gmail.com>
Committer: Seudin Kasumovic <seudin.kasumovic(a)gmail.com>
Date: 2018-01-04T09:28:01+01:00
erlang: fix restore index of parsed tuple
Avoid to change origin index while parsing tuple.
(cherry picked from commit 74778f3ac75432d475e9d54dc56f9c3b95c178a5)
---
Modified: src/modules/erlang/handle_rpc.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a6480c2b8f63ed02aebc13152b8c361…
Patch:
https://github.com/kamailio/kamailio/commit/a6480c2b8f63ed02aebc13152b8c361…
---
diff --git a/src/modules/erlang/handle_rpc.c b/src/modules/erlang/handle_rpc.c
index b852892d9d..d45351bcc2 100644
--- a/src/modules/erlang/handle_rpc.c
+++ b/src/modules/erlang/handle_rpc.c
@@ -486,10 +486,10 @@ int erl_rpc_struct_scan(erl_rpc_ctx_t* ctx, char* fmt, ...)
va_list ap;
- /* save index */
+ /* preserve index */
index = ctx->request_index;
- if(ei_decode_tuple_header(ctx->request->buff,&ctx->request_index,
&arity))
+ if(ei_decode_tuple_header(ctx->request->buff,&index, &arity))
{
erl_rpc_fault(ctx,400,"Bad tuple");
return -1;
@@ -561,9 +561,6 @@ int erl_rpc_struct_scan(erl_rpc_ctx_t* ctx, char* fmt, ...)
fmt++;
}
- /* restore index */
- ctx->request_index = index;
-
va_end(ap);
return reads-modifiers;