diff options
author | Amar Tumballi <amar@gluster.com> | 2010-09-28 11:01:38 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-28 21:54:17 -0700 |
commit | 4e72e3ac439bab76880236a87558fc54009c007c (patch) | |
tree | b56d5d3f351fe8be19688e446ece2d00314531ed /rpc/rpc-lib | |
parent | 2e8f8e85e9f5ccbefe834498d4cf665728c70303 (diff) |
rpc-clnt: handle NULL dereferences
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1723 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1723
Diffstat (limited to 'rpc/rpc-lib')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index 856fcfb501e..3019daebbcf 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -325,15 +325,17 @@ saved_frames_unwind (struct saved_frames *saved_frames) sizeof(timestr) - strlen (timestr), ".%"GF_PRI_SUSECONDS, trav->saved_at.tv_usec); - gf_log ("rpc-clnt", GF_LOG_ERROR, - "forced unwinding frame type(%s) op(%s(%d)) " + if (!trav->rpcreq || !trav->rpcreq->prog) + continue; + + gf_log ("rpc-clnt", GF_LOG_ERROR, + "forced unwinding frame type(%s) op(%s(%d)) " "called at %s", - trav->rpcreq->prog->progname, + trav->rpcreq->prog->progname, (trav->rpcreq->prog->procnames) ? trav->rpcreq->prog->procnames[trav->rpcreq->procnum] : "--", trav->rpcreq->procnum, timestr); - saved_frames->count--; trav->rpcreq->rpc_status = -1; @@ -1401,9 +1403,11 @@ out: } if (frame && (ret == -1)) { - rpcreq->rpc_status = -1; - cbkfn (rpcreq, NULL, 0, frame); - mem_put (rpc->reqpool, rpcreq); + if (rpcreq) { + rpcreq->rpc_status = -1; + cbkfn (rpcreq, NULL, 0, frame); + mem_put (rpc->reqpool, rpcreq); + } } return ret; } |