Networking error and overwriting #252

Closed
opened 2026-01-29 16:38:58 +00:00 by claunia · 5 comments
Owner

Originally created by @sidgairo18 on GitHub (Jan 21, 2017).

Originally assigned to: @rkuchumov on GitHub.

overwrite_var: Overwriting handle sockfd in sockfd = socket(p->ai_family, SOCK_STREAM, p->ai_protocol) leaks the handle.

File src.lib_ccx/networking.c function tcp_bing()

Originally created by @sidgairo18 on GitHub (Jan 21, 2017). Originally assigned to: @rkuchumov on GitHub. overwrite_var: Overwriting handle `sockfd` in `sockfd = socket(p->ai_family, SOCK_STREAM, p->ai_protocol)` leaks the handle. File src.lib_ccx/networking.c function `tcp_bing()`
claunia added the GCI19 label 2026-01-29 16:38:58 +00:00
Author
Owner

@sidgairo18 commented on GitHub (Jan 21, 2017):

@cfsmp3 could you help out with this. Thank you.

@sidgairo18 commented on GitHub (Jan 21, 2017): @cfsmp3 could you help out with this. Thank you.
Author
Owner

@cfsmp3 commented on GitHub (Jan 23, 2017):

I can see the possible leak... This is Ruslan's code so I'm assigning it to him to check out.

@cfsmp3 commented on GitHub (Jan 23, 2017): I can see the possible leak... This is Ruslan's code so I'm assigning it to him to check out.
Author
Owner

@cfsmp3 commented on GitHub (Jan 12, 2018):

Going over this old thing... if seems only possible if setsockopt fails on IPv6 and we continue over the loop to try the next address.

@rkuchumov @sidgairo18

@cfsmp3 commented on GitHub (Jan 12, 2018): Going over this old thing... if seems only possible if setsockopt fails on IPv6 and we continue over the loop to try the next address. @rkuchumov @sidgairo18
Author
Owner

@rkuchumov commented on GitHub (Jan 15, 2018):

According to the manual (setsockopt(2) and ip(7)) it can fail in the following cases:

  1. not valid sockfd
  2. wrong pointers or length
  3. not valid args for IP_ADD_MEMBERSHIP option

In this code only 1. is possible, which doesn't require closing the socket.

@cfsmp3 @sidgairo18

@rkuchumov commented on GitHub (Jan 15, 2018): According to the manual (setsockopt(2) and ip(7)) it can fail in the following cases: 1. not valid sockfd 2. wrong pointers or length 3. not valid args for IP_ADD_MEMBERSHIP option In this code only 1. is possible, which doesn't require closing the socket. @cfsmp3 @sidgairo18
Author
Owner

@cfsmp3 commented on GitHub (Oct 15, 2018):

Closing due to inactivity

@cfsmp3 commented on GitHub (Oct 15, 2018): Closing due to inactivity
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#252