If for whatever reason the child pid is zero, we would kill ourselves
since killing 0 means killing the own process group.
Reported-By: Joshua Rogers <contact@joshua.hu>
Found-By: Zeropath
Change-Id: I7b94de92723f9528b01cb932bb079eedf0f1f272
Signed-off-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1319
Message-Id: <
20251027213308.5588-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33910.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
close(tt->fd);
tt->fd = 0;
}
- kill(tt->afunix.childprocess, SIGINT);
+ /* only kill the child process if the PID is not 0 to avoid killing
+ * ourselves by accident */
+ if (tt->afunix.childprocess)
+ {
+ kill(tt->afunix.childprocess, SIGINT);
+ }
free(tt->actual_name);
free(tt);