Browse code

kamcmd: do binrpc read in non-strict mode

- reported by Dmitri Savolainen, GH#145

Daniel-Constantin Mierla authored on 26/08/2015 17:07:11
Showing 1 changed files
... ...
@@ -892,7 +892,7 @@ static int print_body(struct binrpc_parse_ctx* in_pkt,
892 892
 read_value:
893 893
 		val.name.s=0;
894 894
 		val.name.len=0;
895
-		p=binrpc_read_record(in_pkt, p, end, &val, &ret);
895
+		p=binrpc_read_record(in_pkt, p, end, &val, 1, &ret);
896 896
 		if (ret<0){
897 897
 			if (fmt)
898 898
 				putchar('\n');
... ...
@@ -902,7 +902,7 @@ read_value:
902 902
 				printf("end of message detected\n");
903 903
 				break;
904 904
 			}
905
-			fprintf(stderr, "ERROR while parsing the record %d,"
905
+			fprintf(stderr, "ERROR:: while parsing the record %d,"
906 906
 					" @%d: %02x : %s\n", rec,
907 907
 					in_pkt->offset, *p, binrpc_error(ret));
908 908
 			goto error;
... ...
@@ -1161,13 +1161,13 @@ static struct binrpc_val* parse_reply_body(int* records,
1161 1161
 		val.type=BINRPC_T_ALL;
1162 1162
 		val.name.s=0;
1163 1163
 		val.name.len=0;
1164
-		p=binrpc_read_record(in_pkt, p, end, &val, &ret);
1164
+		p=binrpc_read_record(in_pkt, p, end, &val, 1, &ret);
1165 1165
 		if (ret<0){
1166 1166
 			if (ret==E_BINRPC_EOP){
1167 1167
 				printf("end of message detected\n");
1168 1168
 				break;
1169 1169
 			}
1170
-			fprintf(stderr, "ERROR while parsing the record %d,"
1170
+			fprintf(stderr, "ERROR: while parsing the record %d,"
1171 1171
 					" @%d: %02x : %s\n", rec,
1172 1172
 					in_pkt->offset, *p, binrpc_error(ret));
1173 1173
 			goto error;