summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoru.harbuz <u.harbuz@samsung.com>2017-05-25 15:42:39 (GMT)
committeru.harbuz <u.harbuz@samsung.com>2017-05-26 07:45:01 (GMT)
commit80352ee161fb86501c2543be4d3bad185fda4f22 (patch)
tree7cf4b9bd3e544798d7bb6a7b67f3977a3c360f1c
parent0a4a8339520b245f2cd2a2c354225ed084096979 (diff)
downloadxmlsec1-80352ee161fb86501c2543be4d3bad185fda4f22.zip
xmlsec1-80352ee161fb86501c2543be4d3bad185fda4f22.tar.gz
xmlsec1-80352ee161fb86501c2543be4d3bad185fda4f22.tar.bz2
Change-Id: Id72252c050659e02c650bf58c19d9301c83c22d6
-rw-r--r--src/errors.c3
-rw-r--r--src/io.c6
-rw-r--r--src/openssl/app.c8
-rw-r--r--src/xmldsig.c8
-rw-r--r--src/xmltree.c4
5 files changed, 15 insertions, 14 deletions
diff --git a/src/errors.c b/src/errors.c
index 2ff1f42..a451927 100644
--- a/src/errors.c
+++ b/src/errors.c
@@ -229,9 +229,8 @@ xmlSecError(const char* file, int line, const char* func,
if(msg != NULL) {
va_list va;
-
va_start(va, msg);
- xmlSecStrVPrintf(error_msg, sizeof(error_msg), BAD_CAST msg, va);
+ xmlSecStrVPrintf(error_msg, sizeof(error_msg), msg, va);
error_msg[sizeof(error_msg) - 1] = '\0';
va_end(va);
} else {
diff --git a/src/io.c b/src/io.c
index dcebfc0..7531a7d 100644
--- a/src/io.c
+++ b/src/io.c
@@ -423,13 +423,14 @@ xmlSecTransformInputURIOpen(xmlSecTransformPtr transform, const xmlChar *uri) {
char buf[ERR_BUF_SIZE];
if((ctx->clbks == NULL) || (ctx->clbksCtx == NULL)) {
+ strerror_r(errno, buf, sizeof(buf));
xmlSecError(XMLSEC_ERRORS_HERE,
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
"opencallback",
XMLSEC_ERRORS_R_IO_FAILED,
"uri=%s;error=%s",
xmlSecErrorsSafeString(uri),
- strerror_r(errno, buf, sizeof(buf)));
+ buf);
return(-1);
}
@@ -523,11 +524,12 @@ xmlSecTransformInputURIPopBin(xmlSecTransformPtr transform, xmlSecByte* data,
ret = (ctx->clbks->readcallback)(ctx->clbksCtx, (char*)data, (int)maxDataSize);
if(ret < 0) {
char buf[ERR_BUF_SIZE];
+ strerror_r(errno, buf, sizeof(buf));
xmlSecError(XMLSEC_ERRORS_HERE,
xmlSecErrorsSafeString(xmlSecTransformGetName(transform)),
"readcallback",
XMLSEC_ERRORS_R_IO_FAILED,
- "error=%s", strerror_r(errno, buf, sizeof(buf)));
+ "error=%s", buf);
return(-1);
}
(*dataSize) = ret;
diff --git a/src/openssl/app.c b/src/openssl/app.c
index 8e51988..d7bb79e 100644
--- a/src/openssl/app.c
+++ b/src/openssl/app.c
@@ -1560,9 +1560,9 @@ xmlSecOpenSSLDefaultPasswordCallback(char *buf, int bufsize, int verify, void *u
/* try 3 times */
for(i = 0; i < 3; i++) {
if(filename != NULL) {
- xmlSecStrPrintf(prompt, sizeof(prompt), BAD_CAST "Enter password for \"%s\" file: ", filename);
+ xmlSecStrPrintf(prompt, sizeof(prompt), "Enter password for \"%s\" file: ", filename);
} else {
- xmlSecStrPrintf(prompt, sizeof(prompt), BAD_CAST "Enter password: ");
+ xmlSecStrPrintf(prompt, sizeof(prompt), "Enter password: ");
}
ret = EVP_read_pw_string(buf, bufsize, (char*)prompt, 0);
if(ret != 0) {
@@ -1580,9 +1580,9 @@ xmlSecOpenSSLDefaultPasswordCallback(char *buf, int bufsize, int verify, void *u
}
if(filename != NULL) {
- xmlSecStrPrintf(prompt, sizeof(prompt), BAD_CAST "Enter password for \"%s\" file again: ", filename);
+ xmlSecStrPrintf(prompt, sizeof(prompt), "Enter password for \"%s\" file again: ", filename);
} else {
- xmlSecStrPrintf(prompt, sizeof(prompt), BAD_CAST "Enter password again: ");
+ xmlSecStrPrintf(prompt, sizeof(prompt), "Enter password again: ");
}
buf2 = (char*)xmlMalloc(bufsize);
diff --git a/src/xmldsig.c b/src/xmldsig.c
index 8e156e2..304a869 100644
--- a/src/xmldsig.c
+++ b/src/xmldsig.c
@@ -918,13 +918,13 @@ xmlSecDecodeCmp(const xmlChar* encoded, const xmlChar* plain) {
xmlSecAssert2(encoded != NULL, -1);
xmlSecAssert2(plain != NULL, -1);
- while(*plain != NULL) {
- if(*encoded == NULL)
+ while(*plain != '\0') {
+ if(*encoded == '\0')
return(-1);
/* check encoded char is same with plain char */
if(*encoded == '%') {
- if(*(encoded + 1) == NULL && *(encoded + 2) == NULL)
+ if(*(encoded + 1) == '\0' &&*(encoded + 2) == '\0')
return(-1);
if((int)*plain !=
@@ -984,7 +984,7 @@ xmlSecDSigCtxProcessReferences(xmlSecDSigCtxPtr dsigCtx, xmlNodePtr firstReferen
xmlSecProxyCtxPtr pc = dsigCtx->skipReferences;
while(pc != NULL) {
- if(strncmp(refUri, pc->cache, xmlStrlen(refUri)) == 0) {
+ if(strncmp((char*)refUri, (char*)pc->cache, xmlStrlen(refUri)) == 0) {
isInProxy = 1;
xmlSecError(XMLSEC_ERRORS_HERE,
NULL,
diff --git a/src/xmltree.c b/src/xmltree.c
index a675cbc..3ef7f97 100644
--- a/src/xmltree.c
+++ b/src/xmltree.c
@@ -841,7 +841,7 @@ xmlSecGenerateID(const xmlChar* prefix, xmlSecSize len) {
return(NULL);
}
- xmlSecStrPrintf(tmp, tmpLen, BAD_CAST "%s%s", prefix, res);
+ xmlSecStrPrintf(tmp, tmpLen, "%s%s", prefix, res);
xmlFree(res);
res = tmp;
} else {
@@ -1055,7 +1055,7 @@ xmlSecGetQName(xmlNodePtr node, const xmlChar* href, const xmlChar* local) {
xmlSecErrorsSafeString(node->name));
return(NULL);
}
- xmlSecStrPrintf(qname, len, BAD_CAST "%s:%s", ns->prefix, local);
+ xmlSecStrPrintf(qname, len, "%s:%s", ns->prefix, local);
} else {
qname = xmlStrdup(local);
if(qname == NULL) {