forked from wolfSSL/wolfssl
Merge pull request #5062 from dgarske/clang_str
Fix for issue with `error: format string is not a string literal`
This commit is contained in:
@ -2866,6 +2866,10 @@ void *wolfSSL_BIO_get_ex_data(WOLFSSL_BIO *bio, int idx)
|
|||||||
|
|
||||||
#if defined(OPENSSL_EXTRA)
|
#if defined(OPENSSL_EXTRA)
|
||||||
/* returns amount printed on success, negative in fail case */
|
/* returns amount printed on success, negative in fail case */
|
||||||
|
#ifdef __clang__
|
||||||
|
/* tell clang argument 2 is format */
|
||||||
|
__attribute__((__format__ (__printf__, 2, 0)))
|
||||||
|
#endif
|
||||||
int wolfSSL_BIO_vprintf(WOLFSSL_BIO* bio, const char* format, va_list args)
|
int wolfSSL_BIO_vprintf(WOLFSSL_BIO* bio, const char* format, va_list args)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
@ -2929,6 +2933,10 @@ int wolfSSL_BIO_vprintf(WOLFSSL_BIO* bio, const char* format, va_list args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* returns amount printed on success, negative in fail case */
|
/* returns amount printed on success, negative in fail case */
|
||||||
|
#ifdef __clang__
|
||||||
|
/* tell clang argument 2 is format */
|
||||||
|
__attribute__((__format__ (__printf__, 2, 0)))
|
||||||
|
#endif
|
||||||
int wolfSSL_BIO_printf(WOLFSSL_BIO* bio, const char* format, ...)
|
int wolfSSL_BIO_printf(WOLFSSL_BIO* bio, const char* format, ...)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -4276,7 +4276,7 @@ int wolfSSL_GENERAL_NAME_print(WOLFSSL_BIO* out, WOLFSSL_GENERAL_NAME* gen)
|
|||||||
ret = wolfSSL_BIO_printf(out, "DNS:");
|
ret = wolfSSL_BIO_printf(out, "DNS:");
|
||||||
ret = (ret > 0) ? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
|
ret = (ret > 0) ? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
|
||||||
if (ret == WOLFSSL_SUCCESS) {
|
if (ret == WOLFSSL_SUCCESS) {
|
||||||
ret = wolfSSL_BIO_printf(out, gen->d.dNSName->strData);
|
ret = wolfSSL_BIO_printf(out, "%s", gen->d.dNSName->strData);
|
||||||
ret = (ret > 0) ? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
|
ret = (ret > 0) ? WOLFSSL_SUCCESS : WOLFSSL_FAILURE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user