Closed Abeja27 closed 7 months ago
Good catch, the STUN parser indeed reads a 64-bit value aligned on 32 bits only, which is undefined behavior. Your fix looks good to me, would you like to open a PR addressing both ice_controlling
and ice_controlled
?
Okey, I'll do it tomorrow
Done! I've also changed the reservation_token
. Let me know if you need anything else or something is wrong.
Hello,
I'm currently developing an application using libdatachannel and I ran into an issue when receiving a WebRTC connection. The sanitizer flagged a problem related to adressess alignment, and the specific error is as follows:
Though my knowledge in these areas is limited, I checked the source code and think I've identified the problem. It seems that the stun_attr struct is 8 bytes aligned, but the value member is only 4 bytes due to the additional 4 bytes reserved for the type and length members. To address this, I experimented with modifying the code using uint32_t * pointers, and it appears to resolve the issue for me:
I'd appreciate confirmation if my understanding is correct or if I've overlooked something. Just so you know, I'm using a 64-bit machine.
Thanks in advance for your time.