X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Ferr%2Ferr.c;h=b7ca3ded055dc1f57e076ec204fa1cc5caa778ce;hb=03dc77e07bf0f60a39872946405f1188daad3604;hp=e1091e3cf73f703d1c195b96021ca026a707d25e;hpb=25aaa98aa249d26391c1994d2de449562c8b8b99;p=oweals%2Fopenssl.git diff --git a/crypto/err/err.c b/crypto/err/err.c index e1091e3cf7..b7ca3ded05 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -112,7 +112,7 @@ #include #include #include -#include "cryptlib.h" +#include "internal/cryptlib.h" #include #include #include @@ -157,6 +157,7 @@ static ERR_STRING_DATA ERR_str_libraries[] = { {ERR_PACK(ERR_LIB_FIPS, 0, 0), "FIPS routines"}, {ERR_PACK(ERR_LIB_CMS, 0, 0), "CMS routines"}, {ERR_PACK(ERR_LIB_HMAC, 0, 0), "HMAC routines"}, + {ERR_PACK(ERR_LIB_ASYNC, 0, 0), "ASYNC routines"}, {0, NULL}, }; @@ -279,7 +280,7 @@ static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit) int_error_hash = lh_ERR_STRING_DATA_new(); CRYPTO_pop_info(); } - if (int_error_hash) + if (int_error_hash != NULL) ret = int_error_hash; if (lockit) CRYPTO_w_unlock(CRYPTO_LOCK_ERR); @@ -326,7 +327,7 @@ static LHASH_OF(ERR_STATE) *int_thread_get(int create, int lockit) int_thread_hash = lh_ERR_STATE_new(); CRYPTO_pop_info(); } - if (int_thread_hash) { + if (int_thread_hash != NULL) { int_thread_hash_references++; ret = int_thread_hash; } @@ -455,8 +456,8 @@ static void build_SYS_str_reasons(void) char (*dest)[LEN_SYS_STR_REASON] = &(strerror_tab[i - 1]); char *src = strerror(i); if (src != NULL) { - strncpy(*dest, src, sizeof *dest); - (*dest)[sizeof *dest - 1] = '\0'; + strncpy(*dest, src, sizeof(*dest)); + (*dest)[sizeof(*dest) - 1] = '\0'; str->string = *dest; } } @@ -882,7 +883,7 @@ ERR_STATE *ERR_get_state(void) /* ret == the error state, if NULL, make a new one */ if (ret == NULL) { - ret = OPENSSL_malloc(sizeof(ERR_STATE)); + ret = OPENSSL_malloc(sizeof(*ret)); if (ret == NULL) return (&fallback); CRYPTO_THREADID_cpy(&ret->tid, &tid);