crypto/err/err.c:767: error: NULL_DEREFERENCE
  pointer `es` last assigned on line 765 could be null and is dereferenced at line 767, column 9.
Showing all 14 steps of the trace


crypto/err/err.c:761:1: start of procedure ERR_set_mark()
759.   }
760.   
761. > int ERR_set_mark(void)
762.   {
763.       ERR_STATE *es;

crypto/err/err.c:765:5: 
763.       ERR_STATE *es;
764.   
765. >     es = ERR_get_state();
766.   
767.       if (es->bottom == es->top)

crypto/err/err.c:664:1: start of procedure ERR_get_state()
  662.   }
  663.   
  664. > ERR_STATE *ERR_get_state(void)
  665.   {
  666.       ERR_STATE *state = NULL;

crypto/err/err.c:666:5: 
  664.   ERR_STATE *ERR_get_state(void)
  665.   {
  666. >     ERR_STATE *state = NULL;
  667.   
  668.       if (!RUN_ONCE(&err_init, err_do_init))

crypto/err/err.c:668:10: 
  666.       ERR_STATE *state = NULL;
  667.   
  668. >     if (!RUN_ONCE(&err_init, err_do_init))
  669.           return NULL;
  670.   

crypto/threads_pthread.c:63:1: start of procedure CRYPTO_THREAD_run_once()
    61.   }
    62.   
    63. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
    64.   {
    65.       if (pthread_once(once, init) != 0)

crypto/threads_pthread.c:65:9: Taking true branch
    63.   int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
    64.   {
    65.       if (pthread_once(once, init) != 0)
                  ^
    66.           return 0;
    67.   

crypto/threads_pthread.c:66:9: 
    64.   {
    65.       if (pthread_once(once, init) != 0)
    66. >         return 0;
    67.   
    68.       return 1;

crypto/threads_pthread.c:69:1: return from a call to CRYPTO_THREAD_run_once
    67.   
    68.       return 1;
    69. > }
    70.   
    71.   int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))

crypto/err/err.c:668:10: Condition is false
  666.       ERR_STATE *state = NULL;
  667.   
  668.       if (!RUN_ONCE(&err_init, err_do_init))
                  ^
  669.           return NULL;
  670.   

crypto/err/err.c:668:10: Taking true branch
  666.       ERR_STATE *state = NULL;
  667.   
  668.       if (!RUN_ONCE(&err_init, err_do_init))
                  ^
  669.           return NULL;
  670.   

crypto/err/err.c:669:9: 
  667.   
  668.       if (!RUN_ONCE(&err_init, err_do_init))
  669. >         return NULL;
  670.   
  671.       state = CRYPTO_THREAD_get_local(&err_thread_local);

crypto/err/err.c:689:1: return from a call to ERR_get_state
  687.   
  688.       return state;
  689. > }
  690.   
  691.   int ERR_get_next_error_library(void)

crypto/err/err.c:767:9: 
765.       es = ERR_get_state();
766.   
767. >     if (es->bottom == es->top)
768.           return 0;
769.       es->err_flags[es->top] |= ERR_FLAG_MARK;

int ERR_set_mark(void)
{
    ERR_STATE *es;
    es = ERR_get_state();
    if (es->bottom == es->top)
        return 0;
    es->err_flags[es->top] |= ERR_FLAG_MARK;
    return 1;
}
['int ERR_set_mark(void)\n{\n    ERR_STATE *es;\n    es = ERR_get_state();\n    if (es->bottom == es->top)\n        return 0;\n    es->err_flags[es->top] |= ERR_FLAG_MARK;\n    return 1;\n}', 'ERR_STATE *ERR_get_state(void)\n{\n    ERR_STATE *state = NULL;\n    if (!RUN_ONCE(&err_init, err_do_init))\n        return NULL;\n    state = CRYPTO_THREAD_get_local(&err_thread_local);\n    if (state == NULL) {\n        state = OPENSSL_zalloc(sizeof(*state));\n        if (state == NULL)\n            return NULL;\n        if (!CRYPTO_THREAD_set_local(&err_thread_local, state)) {\n            ERR_STATE_free(state);\n            return NULL;\n        }\n        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);\n        ossl_init_thread_start(OPENSSL_INIT_THREAD_ERR_STATE);\n    }\n    return state;\n}', 'int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))\n{\n    if (pthread_once(once, init) != 0)\n        return 0;\n    return 1;\n}']