Module: kamailio
Branch: 5.0
Commit: c973e3ebbc02f420d462165d979b3599640a2cb7
URL:
https://github.com/kamailio/kamailio/commit/c973e3ebbc02f420d462165d979b359…
Author: Seudin Kasumovic <seudin.kasumovic(a)gmail.com>
Committer: Seudin Kasumovic <seudin.kasumovic(a)gmail.com>
Date: 2018-01-04T09:27:52+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/c973e3ebbc02f420d462165d979b359…
Patch:
https://github.com/kamailio/kamailio/commit/c973e3ebbc02f420d462165d979b359…
---
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;