mirror of https://github.com/wolfSSL/wolfssl.git
Merge pull request #6675 from douzzer/20230805-clang-18-tidy-fixes
20230805-clang-18-tidy-fixespull/6683/head
commit
33e31ed41c
|
@ -3759,8 +3759,12 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
|
||||||
resumeCount = 0;
|
resumeCount = 0;
|
||||||
|
|
||||||
cnt++;
|
cnt++;
|
||||||
if (loops > 0 && --loops == 0) {
|
if (loops > 0) {
|
||||||
break; /* out of while loop, done with normal and resume option */
|
if (--loops == 0) {
|
||||||
|
break; /* out of while loop, done with normal and resume
|
||||||
|
* option
|
||||||
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} /* while(1) */
|
} /* while(1) */
|
||||||
|
|
||||||
|
|
|
@ -11853,8 +11853,11 @@ int MatchDomainName(const char* pattern, int len, const char* str)
|
||||||
if (p == '*') {
|
if (p == '*') {
|
||||||
char s;
|
char s;
|
||||||
|
|
||||||
while (--len > 0 &&
|
while (--len > 0) {
|
||||||
(p = (char)XTOLOWER((unsigned char)*pattern++)) == '*') {
|
p = (char)XTOLOWER((unsigned char)*pattern);
|
||||||
|
pattern++;
|
||||||
|
if (p != '*')
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
|
|
|
@ -1192,7 +1192,9 @@ WOLFSSL_X509_EXTENSION* wolfSSL_X509_set_ext(WOLFSSL_X509* x509, int loc)
|
||||||
|
|
||||||
/* Get extension data and copy as ASN1_STRING */
|
/* Get extension data and copy as ASN1_STRING */
|
||||||
tmpIdx = idx + length;
|
tmpIdx = idx + length;
|
||||||
if ((tmpIdx >= (word32)sz) || (input[tmpIdx++] != ASN_OCTET_STRING)) {
|
if ((tmpIdx >= (word32)sz) ||
|
||||||
|
(input[tmpIdx] != ASN_OCTET_STRING))
|
||||||
|
{
|
||||||
WOLFSSL_MSG("Error decoding unknown extension data");
|
WOLFSSL_MSG("Error decoding unknown extension data");
|
||||||
wolfSSL_ASN1_OBJECT_free(ext->obj);
|
wolfSSL_ASN1_OBJECT_free(ext->obj);
|
||||||
wolfSSL_X509_EXTENSION_free(ext);
|
wolfSSL_X509_EXTENSION_free(ext);
|
||||||
|
@ -1203,6 +1205,8 @@ WOLFSSL_X509_EXTENSION* wolfSSL_X509_set_ext(WOLFSSL_X509* x509, int loc)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmpIdx++;
|
||||||
|
|
||||||
if (GetLength(input, &tmpIdx, &length, sz) <= 0) {
|
if (GetLength(input, &tmpIdx, &length, sz) <= 0) {
|
||||||
WOLFSSL_MSG("Error: Invalid Input Length.");
|
WOLFSSL_MSG("Error: Invalid Input Length.");
|
||||||
wolfSSL_ASN1_OBJECT_free(ext->obj);
|
wolfSSL_ASN1_OBJECT_free(ext->obj);
|
||||||
|
|
|
@ -17218,9 +17218,11 @@ static int MatchBaseName(int type, const char* name, int nameSz,
|
||||||
}
|
}
|
||||||
|
|
||||||
while (nameSz > 0) {
|
while (nameSz > 0) {
|
||||||
if (XTOLOWER((unsigned char)*name++) !=
|
if (XTOLOWER((unsigned char)*name) !=
|
||||||
XTOLOWER((unsigned char)*base++))
|
XTOLOWER((unsigned char)*base))
|
||||||
return 0;
|
return 0;
|
||||||
|
name++;
|
||||||
|
base++;
|
||||||
nameSz--;
|
nameSz--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3593,6 +3593,7 @@ char* mystrnstr(const char* s1, const char* s2, unsigned int n)
|
||||||
/* TODO: maybe have to use tx_thread_delete? */
|
/* TODO: maybe have to use tx_thread_delete? */
|
||||||
free(thread.threadStack);
|
free(thread.threadStack);
|
||||||
thread.threadStack = NULL;
|
thread.threadStack = NULL;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(WOLFSSL_ZEPHYR)
|
#elif defined(WOLFSSL_ZEPHYR)
|
||||||
|
@ -3680,7 +3681,7 @@ char* mystrnstr(const char* s1, const char* s2, unsigned int n)
|
||||||
XMEMSET(&thread, 0, sizeof(thread));
|
XMEMSET(&thread, 0, sizeof(thread));
|
||||||
ret = wolfSSL_NewThread(&thread, cb, arg);
|
ret = wolfSSL_NewThread(&thread, cb, arg);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
pthread_detach(thread);
|
ret = pthread_detach(thread);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2215,7 +2215,8 @@ static WC_INLINE void udp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd,
|
||||||
if (bind(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
|
if (bind(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
|
||||||
err_sys_with_errno("tcp bind failed");
|
err_sys_with_errno("tcp bind failed");
|
||||||
|
|
||||||
#if !defined(USE_WINDOWS_API) && !defined(WOLFSSL_TIRTOS)
|
#if !defined(USE_WINDOWS_API) && !defined(WOLFSSL_TIRTOS) && \
|
||||||
|
!defined(SINGLE_THREADED)
|
||||||
if (port == 0) {
|
if (port == 0) {
|
||||||
socklen_t len = sizeof(addr);
|
socklen_t len = sizeof(addr);
|
||||||
if (getsockname(*sockfd, (struct sockaddr*)&addr, &len) == 0) {
|
if (getsockname(*sockfd, (struct sockaddr*)&addr, &len) == 0) {
|
||||||
|
@ -2226,6 +2227,8 @@ static WC_INLINE void udp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)port;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (args != NULL && args->signal != NULL) {
|
if (args != NULL && args->signal != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue