-
-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #1675 undefined behavior in posix ipc_dialer_dial
(This also affects TCP, and fixed there.)
- Loading branch information
Showing
2 changed files
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright 2020 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2023 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2018 Capitar IT Group BV <[email protected]> | ||
// Copyright 2019 Devolutions <[email protected]> | ||
// | ||
|
@@ -188,6 +188,8 @@ ipc_dialer_dial(void *arg, nni_aio *aio) | |
// This arranges for the fd to be in non-blocking mode, and adds the | ||
// poll fd to the list. | ||
if ((rv = nni_posix_pfd_init(&pfd, fd)) != 0) { | ||
// the error label unlocks this | ||
nni_mtx_lock(&d->mtx); | ||
goto error; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright 2021 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2023 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2018 Capitar IT Group BV <[email protected]> | ||
// Copyright 2018 Devolutions <[email protected]> | ||
// | ||
|
@@ -207,6 +207,8 @@ nni_tcp_dial(nni_tcp_dialer *d, const nni_sockaddr *sa, nni_aio *aio) | |
// poll fd to the list. | ||
if ((rv = nni_posix_pfd_init(&pfd, fd)) != 0) { | ||
(void) close(fd); | ||
// the error label unlocks this | ||
nni_mtx_lock(&d->mtx); | ||
goto error; | ||
} | ||
|
||
|