Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom union for handling both sockaddr_in/sockaddr_in6 structures #781

Merged
merged 1 commit into from Nov 7, 2016

Conversation

ton31337
Copy link
Contributor

@ton31337 ton31337 commented Nov 4, 2016

In addition use two MACROs for allocating buffers to store IP addresses, thus saving some space.

(gdb) bt
#0  0x00007f6b1a22cfb3 in inet_ntop () from /lib64/libc.so.6
#1  0x0000000000456189 in MySQL_Thread::listener_handle_new_connection (this=0x7f6b1100d000, myds=0x7f6b1101a200, n=<optimized out>) at MySQL_Thread.cpp:2910
#2  0x000000000045d16e in MySQL_Thread::run (this=this@entry=0x7f6b1100d000) at MySQL_Thread.cpp:2452
#3  0x00000000004390d4 in mysql_worker_thread_func (arg=0x7f6b1863c990) at main.cpp:165
#4  0x00007f6b1b988dc5 in start_thread () from /lib64/libpthread.so.0
#5  0x00007f6b1a21eced in clone () from /lib64/libc.so.6

(gdb) x/16b &(*(struct sockaddr_in6 *)sess->client_myds->client_addr)->sin6_addr
0x7f6b021ffff8:	0x2a	0x02	0x47	0x80	0x0b	0xad	0xf0	0x0d
0x7f6b02200000:	Cannot access memory at address 0x7f6b02200000

@ton31337 ton31337 changed the title Check if IP address is not corrupted Add custom union for handling both sockaddr_in/sockaddr_in6 structures Nov 4, 2016
@renecannao renecannao merged commit 34cb3b3 into sysown:master Nov 7, 2016
@renecannao
Copy link
Contributor

Thanks! Merged in master and v1.3.0

@ton31337 ton31337 deleted the Fix/handle_ipv6_null branch November 7, 2016 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants