crypto/rand/rand_lib.c:858: error: NULL_DEREFERENCE
  pointer `meth` last assigned on line 856 could be null and is dereferenced at line 858, column 9.
Showing all 6 steps of the trace


crypto/rand/rand_lib.c:854:1: start of procedure RAND_pseudo_bytes()
852.   
853.   #if !OPENSSL_API_1_1_0 && !defined(FIPS_MODE)
854. > int RAND_pseudo_bytes(unsigned char *buf, int num)
855.   {
856.       const RAND_METHOD *meth = RAND_get_rand_method();

crypto/rand/rand_lib.c:856:5: 
854.   int RAND_pseudo_bytes(unsigned char *buf, int num)
855.   {
856. >     const RAND_METHOD *meth = RAND_get_rand_method();
857.   
858.       if (meth->pseudorand != NULL)

crypto/rand/rand_lib.c:724:1: start of procedure RAND_get_rand_method()
  722.   #endif
  723.   
  724. > const RAND_METHOD *RAND_get_rand_method(void)
  725.   {
  726.   #ifdef FIPS_MODE

crypto/rand/rand_lib.c:727:5: 
  725.   {
  726.   #ifdef FIPS_MODE
  727. >     return NULL;
  728.   #else
  729.       const RAND_METHOD *tmp_meth = NULL;

crypto/rand/rand_lib.c:756:1: return from a call to RAND_get_rand_method
  754.       return tmp_meth;
  755.   #endif
  756. > }
  757.   
  758.   #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)

crypto/rand/rand_lib.c:858:9: 
856.       const RAND_METHOD *meth = RAND_get_rand_method();
857.   
858. >     if (meth->pseudorand != NULL)
859.           return meth->pseudorand(buf, num);
860.       return -1;

int RAND_pseudo_bytes(unsigned char *buf, int num)
{
    const RAND_METHOD *meth = RAND_get_rand_method();
    if (meth->pseudorand != NULL)
        return meth->pseudorand(buf, num);
    return -1;
}
['int RAND_pseudo_bytes(unsigned char *buf, int num)\n{\n    const RAND_METHOD *meth = RAND_get_rand_method();\n    if (meth->pseudorand != NULL)\n        return meth->pseudorand(buf, num);\n    return -1;\n}', 'const RAND_METHOD *RAND_get_rand_method(void)\n{\n#ifdef FIPS_MODE\n    return NULL;\n#else\n    const RAND_METHOD *tmp_meth = NULL;\n    if (!RUN_ONCE(&rand_init, do_rand_init))\n        return NULL;\n    CRYPTO_THREAD_write_lock(rand_meth_lock);\n    if (default_RAND_meth == NULL) {\n# ifndef OPENSSL_NO_ENGINE\n        ENGINE *e;\n        if ((e = ENGINE_get_default_RAND()) != NULL\n                && (tmp_meth = ENGINE_get_RAND(e)) != NULL) {\n            funct_ref = e;\n            default_RAND_meth = tmp_meth;\n        } else {\n            ENGINE_finish(e);\n            default_RAND_meth = &rand_meth;\n        }\n# else\n        default_RAND_meth = &rand_meth;\n# endif\n    }\n    tmp_meth = default_RAND_meth;\n    CRYPTO_THREAD_unlock(rand_meth_lock);\n    return tmp_meth;\n#endif\n}']