mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
rpc.tlsservd.c: Check the malloc return
The NULL return is used by the following memcpy() call. Fail the request instead. Unlikely to happen in practice, since the rpc.tlsservd daemon runs as root and does not allocate a lot or memory. Reviewed by: rmacklem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D60927
This commit is contained in:
1 parent
9b8bc7b827
commit
6d705f2bf1
1 file changed
+2
@@ -358,6 +358,8 @@ rpctlssd_connect_2_svc(struct rpctlssd_connect_arg *argp,
|
||||
assert(rqstp->rq_xprt == xprt);
|
||||
|
||||
ctx = malloc(sizeof(*ctx));
|
||||
if (ctx == NULL)
|
||||
return (FALSE);
|
||||
memcpy(&ctx->arg, argp, sizeof(ctx->arg));
|
||||
ctx->xid = *(uint32_t *)pthread_getspecific(xidkey);
|
||||
|
||||
|
||||
Reference in new issue
Block a user