Module: kamailio
Branch: 5.6
Commit: 6ac1d7a7cdb49fb8db4ff280c5159098b0b4284f
URL:
https://github.com/kamailio/kamailio/commit/6ac1d7a7cdb49fb8db4ff280c515909…
Author: russagit <rustam.safargalin(a)sifox.ru>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-08-16T11:59:15+02:00
sipt: Fix isup generic_number and generic_number_nai decoding (GH #3209)
(cherry picked from commit 9f3d1c274ad926e9640d0091c9702a34f8b2e539)
---
Modified: src/modules/sipt/ss7_parser.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6ac1d7a7cdb49fb8db4ff280c515909…
Patch:
https://github.com/kamailio/kamailio/commit/6ac1d7a7cdb49fb8db4ff280c515909…
---
diff --git a/src/modules/sipt/ss7_parser.c b/src/modules/sipt/ss7_parser.c
index 30d85cdb1e2..eaac53e5ca0 100644
--- a/src/modules/sipt/ss7_parser.c
+++ b/src/modules/sipt/ss7_parser.c
@@ -570,7 +570,7 @@ int isup_get_generic_number_nai(unsigned char *buf, int len)
if(offset != -1 && len-offset-2 > 1)
{
- return buf[offset+2] & 0x7F;
+ return buf[offset+3] & 0x7F;
}
return -1;
}
@@ -586,13 +586,13 @@ int isup_get_generic_number(unsigned char *buf, int len, char*
sb_buf)
if(offset != -1 && len-offset-2 > 1)
{
sbparamlen = (buf[offset+1] & 0xFF) - 2;
- oddeven = (buf[offset+2] >> 7) & 0x1;
+ oddeven = (buf[offset+3] >> 7) & 0x1;
while ((sbparamlen > 0) && (buf[offset] != 0)) {
- sb_buf[sb_i]="0123456789ABCDEF"[(buf[offset+4+sb_j] & 0x0F)];
+ sb_buf[sb_i]="0123456789ABCDEF"[(buf[offset+5+sb_j] & 0x0F)];
if(sbparamlen > 1 || oddeven == 0)
{
- sb_buf[sb_i+1]="0123456789ABCDEF"[(buf[offset+4+sb_j] >>4 &
0x0F)];
+ sb_buf[sb_i+1]="0123456789ABCDEF"[(buf[offset+5+sb_j] >>4 &
0x0F)];
}
sb_i=sb_i+2;
sbparamlen--;