IPv6 connection causes segfault
Brought to you by:
gyunaev
Using irc_connect6 causes irc_add_select_descriptors to segfault
System is current debian stable.
Minimal example is attached.
Compiled with gcc -lssl -lcrypto -lircclient segfault.c
According to valgrind and gdb the segfault happens during irc_run calling irc_add_select_descriptors and changing irc_connect6 to irc_connect removes the segfault.
libircclient.c line 820 copies the struct sockaddr_in6 into a irc_session_t->local_addr overwriting the two variables behind it. This causes the given error. Patch fixing it is attached.
If it helps the decision to implement this patch:
I can confirm this bug and that the patch resolves it.
Thanks, Cookiemon!