Fix svace defect 65/88465/1 accepted/tizen/3.0/ivi/20161011.070327 accepted/tizen/3.0/mobile/20161015.034308 accepted/tizen/3.0/tv/20161016.010026 accepted/tizen/3.0/wearable/20161015.084630 accepted/tizen/common/20160920.131713 accepted/tizen/ivi/20160920.051127 accepted/tizen/mobile/20160920.051026 accepted/tizen/tv/20160920.051044 accepted/tizen/wearable/20160920.051105 submit/tizen/20160916.180719 submit/tizen_3.0_ivi/20161010.000008 submit/tizen_3.0_mobile/20161015.000007 submit/tizen_3.0_tv/20161015.000006 submit/tizen_3.0_wearable/20161015.000007
authorsangwan.kwon <sangwan.kwon@samsung.com>
Mon, 19 Sep 2016 08:10:40 +0000 (17:10 +0900)
committersangwan.kwon <sangwan.kwon@samsung.com>
Mon, 19 Sep 2016 08:10:40 +0000 (17:10 +0900)
* Check null before variable dereferenced

Change-Id: Ic0716662fb4c7ef7bc67287bbfaacdd32c77f804
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
src/xmldsig.c

index b22ff2b..ec4338c 100644 (file)
@@ -2203,7 +2203,9 @@ xmlSecDSigCtxProcessSignedInfoNodeEx(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr node,
     dsigCtx->signMethod->operation = dsigCtx->operation;
 
     /* calculate references */
-    cur = xmlSecGetNextElementNode(cur->next);
+    if (cur != NULL) {
+        cur = xmlSecGetNextElementNode(cur->next);
+    }
     while((cur != NULL) && (xmlSecCheckNodeName(cur, xmlSecNodeReference, xmlSecDSigNs))) {
         /* create reference */
         dsigRefCtx = xmlSecDSigReferenceCtxCreate(dsigCtx, xmlSecDSigReferenceOriginSignedInfo);