0xffffffff00000000ULL mask does not take into consideration signed 32 bit
integers and as result 2147483648 will be stored as -2147483648.
Another mask should be used to correct the issue: 0xffffffff80000000ULL.
It processes correctly the case of integers that are greater than 2147483647.

There are several gdb tests below:
(gdb) p ((unsigned long long)2147483648 & 0xffffffff80000000ULL)
$1= 2147483648
(gdb) p ((unsigned long long)2147483647 & 0xffffffff80000000ULL)
$2 = 0
(gdb) p ((unsigned long long)2147483646 & 0xffffffff80000000ULL)
$3 = 0
(gdb) p ((unsigned long long)4147483646 & 0xffffffff80000000ULL)
$4 = 2147483648

Pre-Submission Checklist

Type Of Change

Checklist:

Description


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/2106

Commit Summary

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.