Opened 17 years ago

Last modified 17 years ago

#306 closed defect

Error in SIP transport lookup because of memory alignment problem (thanks Samuel Vinson) — at Initial Version

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-0.7.0
Component: pjsip Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description

The key for looking up transport in hash table is declared like this:

struct transport_key
{
    pjsip_transport_type_e  type;
    pj_sockaddr             addr;
};

This causes a problem when the compiler maps type field to char data type and when the addr field starts at transport_key+4, because there are three unitialized bytes between type and addr.

More over, the key length is calculated as sizeof(key.addr) + addr_len, so this would cause the several bytes of the key to be ignored.

Thanks Samuel Vinson <samuelv at users.sourceforge.net> for pointing this out!

Change History (0)

Note: See TracTickets for help on using tickets.