Module: kamailio
Branch: master
Commit: 74778f3ac75432d475e9d54dc56f9c3b95c178a5
URL:
https://github.com/kamailio/kamailio/commit/74778f3ac75432d475e9d54dc56f9c3…
Author: Seudin Kasumovic <seudin.kasumovic(a)gmail.com>
Committer: Seudin Kasumovic <seudin.kasumovic(a)gmail.com>
Date: 2018-01-03T23:21:41+01:00
erlang: fix restore index of parsed tuple
Avoid to change origin index while parsing tuple.
---
Modified: src/modules/erlang/handle_rpc.c
---
Diff:
https://github.com/kamailio/kamailio/commit/74778f3ac75432d475e9d54dc56f9c3…
Patch:
https://github.com/kamailio/kamailio/commit/74778f3ac75432d475e9d54dc56f9c3…
---
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;