diff options
author | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-10-13 16:42:08 +0900 |
---|---|---|
committer | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-10-13 16:57:45 +0900 |
commit | daf2259d9baccb7027b2037175f6e85badc1e426 (patch) | |
tree | 3b277727bf4e72a633f29fbbc06eb7d5e093c34b | |
parent | bbbe2212ab41c01fe309081dccb523af5b32a110 (diff) | |
download | xmlsec1-submit/tizen_3.0_common/20161104.104000.tar.gz xmlsec1-submit/tizen_3.0_common/20161104.104000.tar.bz2 xmlsec1-submit/tizen_3.0_common/20161104.104000.zip |
Add NULL check logic on custum codesubmit/tizen_3.0_common/20161104.104000submit/tizen_3.0/20161028.092423submit/tizen_3.0/20161028.062323submit/tizen/20161013.081319accepted/tizen/wearable/20161014.022400accepted/tizen/tv/20161014.022258accepted/tizen/mobile/20161014.022513accepted/tizen/ivi/20161014.022342accepted/tizen/common/20161013.160032accepted/tizen/3.0/wearable/20161028.150839accepted/tizen/3.0/tv/20161028.143520accepted/tizen/3.0/mobile/20161028.143209accepted/tizen/3.0/ivi/20161028.151242accepted/tizen/3.0/common/20161114.112005
Change-Id: I67a3e6e56af41e9cc0a8d27ded98895519f47650
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
-rw-r--r-- | src/xmldsig.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/xmldsig.c b/src/xmldsig.c index 0664c485..db33058e 100644 --- a/src/xmldsig.c +++ b/src/xmldsig.c @@ -913,6 +913,10 @@ xmlSecHexToInt(char a) static int xmlSecDecodeCmp(const xmlChar* encoded, const xmlChar* plain) { + + xmlSecAssert2(encoded != NULL, -1); + xmlSecAssert2(plain != NULL, -1); + while(*plain != NULL) { if(*encoded == NULL) return(-1); @@ -966,6 +970,16 @@ xmlSecDSigCtxProcessReferences(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr firstReferen int isInProxy = 0; if(dsigCtx->proxyCtxPtr != NULL) { xmlChar* refUri = xmlGetProp(cur, xmlSecAttrURI); + if(refUri == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + NULL, + NULL, + XMLSEC_ERRORS_R_INVALID_NODE_ATTRIBUTE, + "node=%s", + xmlSecErrorsSafeString(xmlSecNodeGetName(cur))); + return(-1); + } + xmlSecError(XMLSEC_ERRORS_HERE, NULL, NULL, @@ -974,7 +988,6 @@ xmlSecDSigCtxProcessReferences(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr firstReferen refUri); xmlSecProxyCtxPtr pc = dsigCtx->proxyCtxPtr; - int uriLen = strlen((const char*)refUri); while(pc != NULL) { if(xmlSecDecodeCmp(refUri, pc->cache) == 0) { isInProxy = 1; |