Closed TERESH1 closed 2 months ago
Possible uninitialized data is read from local variable sfd at libinetsocket.c:221. https://github.com/dermesser/libsocket/blob/1a4480a1214cb68cbf28c7f7050cdd76ab85d6f0/C/inet/libinetsocket.c#L155 https://github.com/dermesser/libsocket/blob/1a4480a1214cb68cbf28c7f7050cdd76ab85d6f0/C/inet/libinetsocket.c#L221
sfd
Handler sfd is passed to a function at libinetsocket.c:221 by calling function close after the handler may already be closed at libinetsocket.c:209. https://github.com/dermesser/libsocket/blob/1a4480a1214cb68cbf28c7f7050cdd76ab85d6f0/C/inet/libinetsocket.c#L194-L221
close
Setting fd to -1 would avoid the risk of closing a socket that another thread had just opened
Found with Svace
Possible uninitialized data is read from local variable
sfd
at libinetsocket.c:221. https://github.com/dermesser/libsocket/blob/1a4480a1214cb68cbf28c7f7050cdd76ab85d6f0/C/inet/libinetsocket.c#L155 https://github.com/dermesser/libsocket/blob/1a4480a1214cb68cbf28c7f7050cdd76ab85d6f0/C/inet/libinetsocket.c#L221Handler
sfd
is passed to a function at libinetsocket.c:221 by calling functionclose
after the handler may already be closed at libinetsocket.c:209. https://github.com/dermesser/libsocket/blob/1a4480a1214cb68cbf28c7f7050cdd76ab85d6f0/C/inet/libinetsocket.c#L194-L221Setting fd to -1 would avoid the risk of closing a socket that another thread had just opened
Found with Svace