Calling abort() while trying to listen using UDP
The networking swiss army knife
Status: Beta
Brought to you by:
themnemonic
Hello,
It is crashing (calling abort()) using the following syntax:
./netcat -4 -vv -l -u -p 4444
(gdb) set args -4 -vv -l -u -p 4444
(gdb) r
Starting program: /home/sky/netcat-code/src/netcat -4 -vv -l -u -p 4444
Program received signal SIGABRT, Aborted.
0x00007ffff7a4bcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff7a4bcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff7a4f0d8 in __GI_abort () at abort.c:89
#2 0x0000000000406bfd in netcat_socket_new (domain=NETCAT_DOMAIN_IPV6, proto=NETCAT_PROTO_UDP) at network.c:396
#3 0x00000000004041b1 in core_udp_listen (ncsock=0x7fffffffd470) at netcore.c:104
#4 0x000000000040520d in core_listen (ncsock=0x7fffffffd470) at netcore.c:520
#5 0x0000000000403a41 in main (argc=7, argv=0x7fffffffe0e8) at netcat.c:515
(gdb)
The problem is in netcore.c line 104 where it is using PF_INET while should use the enum nc_domain_t.
Actually, it is happening two times in the code (always for UDP)
I am attaching a patch file ok?
Thanks
Hello,
please, consider this last patch file.
Thanks