Module: kamailio Branch: master Commit: 68940cc09c999621b1f9a765e190b3207728106e URL: https://github.com/kamailio/kamailio/commit/68940cc09c999621b1f9a765e190b320...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2023-12-15T12:19:25+01:00
seas: use same type iterator to avoid risk of overflow
---
Modified: src/modules/seas/encode_header.c
---
Diff: https://github.com/kamailio/kamailio/commit/68940cc09c999621b1f9a765e190b320... Patch: https://github.com/kamailio/kamailio/commit/68940cc09c999621b1f9a765e190b320...
---
diff --git a/src/modules/seas/encode_header.c b/src/modules/seas/encode_header.c index 055821d37d5..e59d422861c 100644 --- a/src/modules/seas/encode_header.c +++ b/src/modules/seas/encode_header.c @@ -366,6 +366,7 @@ int print_encoded_header(FILE *fd, char *msg, int msglen, { char *hdr_start_ptr; short int start_idx, i; + int j;
memcpy(&start_idx, payload, 2); start_idx = ntohs(start_idx); @@ -378,9 +379,9 @@ int print_encoded_header(FILE *fd, char *msg, int msglen, hdr_start_ptr); fprintf(fd, "%sHEADER:[%.*s]\n", prefix, i - 2, hdr_start_ptr); fprintf(fd, "%sHEADER CODE=", prefix); - for(i = 0; i < len; i++) - fprintf(fd, "%s%d%s", i == 0 ? "[" : ":", payload[i], - i == len - 1 ? "]\n" : ""); + for(j = 0; j < len; j++) + fprintf(fd, "%s%d%s", j == 0 ? "[" : ":", payload[j], + j == len - 1 ? "]\n" : ""); if(len == 4) return 1; switch(type) {