Module: kamailio
Branch: master
Commit: 6b73ca89832e034239d6f17d41b825cfdc52424d
URL:
https://github.com/kamailio/kamailio/commit/6b73ca89832e034239d6f17d41b825c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-08-26T19:07:11+02:00
kamcmd: do binrpc read in non-strict mode
- reported by Dmitri Savolainen, GH#145
---
Modified: utils/kamcmd/kamcmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6b73ca89832e034239d6f17d41b825c…
Patch:
https://github.com/kamailio/kamailio/commit/6b73ca89832e034239d6f17d41b825c…
---
diff --git a/utils/kamcmd/kamcmd.c b/utils/kamcmd/kamcmd.c
index 97d5820..3381631 100644
--- a/utils/kamcmd/kamcmd.c
+++ b/utils/kamcmd/kamcmd.c
@@ -892,7 +892,7 @@ static int print_body(struct binrpc_parse_ctx* in_pkt,
read_value:
val.name.s=0;
val.name.len=0;
- p=binrpc_read_record(in_pkt, p, end, &val, &ret);
+ p=binrpc_read_record(in_pkt, p, end, &val, 1, &ret);
if (ret<0){
if (fmt)
putchar('\n');
@@ -902,7 +902,7 @@ static int print_body(struct binrpc_parse_ctx* in_pkt,
printf("end of message detected\n");
break;
}
- fprintf(stderr, "ERROR while parsing the record %d,"
+ fprintf(stderr, "ERROR:: while parsing the record %d,"
" @%d: %02x : %s\n", rec,
in_pkt->offset, *p, binrpc_error(ret));
goto error;
@@ -1161,13 +1161,13 @@ static struct binrpc_val* parse_reply_body(int* records,
val.type=BINRPC_T_ALL;
val.name.s=0;
val.name.len=0;
- p=binrpc_read_record(in_pkt, p, end, &val, &ret);
+ p=binrpc_read_record(in_pkt, p, end, &val, 1, &ret);
if (ret<0){
if (ret==E_BINRPC_EOP){
printf("end of message detected\n");
break;
}
- fprintf(stderr, "ERROR while parsing the record %d,"
+ fprintf(stderr, "ERROR: while parsing the record %d,"
" @%d: %02x : %s\n", rec,
in_pkt->offset, *p, binrpc_error(ret));
goto error;