diff options
author | Tomas Popela <tpopela@redhat.com> | 2018-07-23 11:53:13 +0200 |
---|---|---|
committer | David King <amigadave@amigadave.com> | 2019-01-21 14:38:59 +0000 |
commit | cbf737eaa23f22fb73b439a2c76a0e18080d7a87 (patch) | |
tree | 4f82a7d0afa03b677f66289de5d5314c0916497e | |
parent | 0b3b23c5b389dd5524c6674fc6301510181f2de4 (diff) | |
download | yelp-cbf737eaa23f22fb73b439a2c76a0e18080d7a87.tar.gz |
Swap the if() checks to avoid possible null pointer dereference
yelp-3.28.1/libyelp/yelp-transform.c:501: deref_ptr: Directly dereferencing pointer "ctxt".
yelp-3.28.1/libyelp/yelp-transform.c:504: check_after_deref: Null-checking "ctxt" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
-rw-r--r-- | libyelp/yelp-transform.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libyelp/yelp-transform.c b/libyelp/yelp-transform.c index 7a5dc86e..0a1c8058 100644 --- a/libyelp/yelp-transform.c +++ b/libyelp/yelp-transform.c @@ -498,10 +498,10 @@ xslt_yelp_document (xsltTransformContextPtr ctxt, debug_print (DB_FUNCTION, "entering\n"); - if (ctxt->state == XSLT_STATE_STOPPED) + if (!ctxt || !node || !inst || !comp) return; - if (!ctxt || !node || !inst || !comp) + if (ctxt->state == XSLT_STATE_STOPPED) return; transform = YELP_TRANSFORM (ctxt->_private); |