aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-31 15:06:43 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-31 15:06:43 -0800
commit8e24f5b19bcadaf0c08bb6e3b7583461f703b269 (patch)
tree739c8975a979f88b901fffc7f611b8651f317b29 /src
parentd8ffb0b277e7f5d5edc17585543ee78921efc077 (diff)
downloadnng-8e24f5b19bcadaf0c08bb6e3b7583461f703b269.tar.gz
nng-8e24f5b19bcadaf0c08bb6e3b7583461f703b269.tar.bz2
nng-8e24f5b19bcadaf0c08bb6e3b7583461f703b269.zip
Finally closed the silly endpoint / pipe use-after-free race.
Diffstat (limited to 'src')
-rw-r--r--src/core/endpt.c1
-rw-r--r--src/core/pipe.c1
2 files changed, 1 insertions, 1 deletions
diff --git a/src/core/endpt.c b/src/core/endpt.c
index 67d17cea..9c3d9b50 100644
--- a/src/core/endpt.c
+++ b/src/core/endpt.c
@@ -115,6 +115,7 @@ nni_endpt_connect(nni_endpt *ep, nni_pipe **pp)
return (rv);
}
ep->ep_pipe = pipe;
+ pipe->p_ep = ep;
*pp = pipe;
return (0);
}
diff --git a/src/core/pipe.c b/src/core/pipe.c
index c485b125..b12a7f1c 100644
--- a/src/core/pipe.c
+++ b/src/core/pipe.c
@@ -115,7 +115,6 @@ nni_pipe_create(nni_pipe **pp, nni_endpt *ep)
}
p->p_sock = sock;
p->p_ops = *ep->ep_ops.ep_pipe_ops;
- p->p_ep = ep;
NNI_LIST_NODE_INIT(&p->p_node);
*pp = p;
return (0);