[sunrpc] Fix possible null-pointer dereference.

Message ID 20220331133253.351748-1-d.chestnyh@omp.ru
State New
Series [sunrpc] Fix possible null-pointer dereference. |


Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Dmitry Chestnyh March 31, 2022, 1:32 p.m. UTC
  This issue was found by SVACE static analyzer.
In clntunix_call function there are no
obvious checks of xdr_results ptr value.
And seems that we can't be sure that this pointer
isn't NULL.
 sunrpc/clnt_unix.c | 1 +
 1 file changed, 1 insertion(+)


diff --git a/sunrpc/clnt_unix.c b/sunrpc/clnt_unix.c
index 33a02cc8af..8c303d3ef6 100644
--- a/sunrpc/clnt_unix.c
+++ b/sunrpc/clnt_unix.c
@@ -278,6 +278,7 @@  call_again:
   _seterr_reply (&reply_msg, &(ct->ct_error));
   if (ct->ct_error.re_status == RPC_SUCCESS)
+      assert(xdr_results != NULL);
       if (!AUTH_VALIDATE (h->cl_auth, &reply_msg.acpted_rply.ar_verf))
 	  ct->ct_error.re_status = RPC_AUTHERROR;