#2020 closed defect (fixed)
pj_hash_calc_tolower() might return a different hash value
Reported by: | riza | Owned by: | bennylp |
---|---|---|---|
Priority: | normal | Milestone: | release-2.7 |
Component: | pjlib | Version: | trunk |
Keywords: | Cc: | ||
Backport to 1.x milestone: | Backported: | no |
Description
Example scenario:
- Received INVITE with branch=z9hG4bK%999999f
- Respond with 100
- Respond with 180
- Received CANCEL
- Respond with "481 Call/Transaction Does Not Exist"
By default, sip_transaction.c enabled PRECALC_HASH which calculated the hash value using pj_hash_calc_lower().
char lower = (char)pj_tolower(key->ptr[i]);
When setting the hash, the value was calculated using
const pj_uint8_t *p = (const pj_uint8_t*)key,*end = p + keylen; hash = hash * PJ_HASH_MULTIPLIER + pj_tolower(*p);
The branch/key contain %99, which will be stored as 0x99,
the calculated hash value will differ.
Thanks to Fredrik Hansson for the report.
Change History (1)
comment:1 Changed 7 years ago by riza
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
In r5600:
Fixed #2020: Method pj_hash_calc_tolower() might return a different hash
value.