Type Of Change

Checklist:

Description

This fixes mtree to be able to contain strings with character
values larger than 0x80. Previously this would not work because
the str.s[i] is 'char' and when cast to 'unsigned int' it would
be first sign extended for maximum range (on systems where 'char'
defaults to signed). E.g. on x86_64 system:
(unsigned int)(char)0x80 = 4294967168

The >=MT_CHAR_TABLE_SIZE test would filter any string containing
these characters out as invalid.

Code is fixed to cast _mt_char_table index to 'unsigned char'
always so index is within range always. The new redundant checks
against MT_CHAR_TABLE_SIZE are removed, and the result is stored
to local variable (and used from it) to improve code readability.

The error message in mt_add_to_tree() is harmonized with the other
messages to show the full string with a problem.


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

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

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 mute the thread.