crypto/objects/o_names.c:99: error: NULL_DEREFERENCE
  pointer `name_funcs` last assigned on line 97 could be null and is dereferenced at line 99, column 9.
Showing all 181 steps of the trace


crypto/objects/o_names.c:64:1: start of procedure OBJ_NAME_new_index()
62.   }
63.   
64. > int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
65.                          int (*cmp_func) (const char *, const char *),
66.                          void (*free_func) (const char *, int, const char *))

crypto/objects/o_names.c:72:9: Taking true branch
70.       NAME_FUNCS *name_funcs;
71.   
72.       if (name_funcs_stack == NULL) {
              ^
73.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
74.           name_funcs_stack = sk_NAME_FUNCS_new_null();

crypto/objects/o_names.c:73:9: 
71.   
72.       if (name_funcs_stack == NULL) {
73. >         CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
74.           name_funcs_stack = sk_NAME_FUNCS_new_null();
75.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
  202.   #endif
  203.   
  204. > int CRYPTO_mem_ctrl(int mode)
  205.   {
  206.   #ifndef CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
  205.   {
  206.   #ifndef CRYPTO_MDEBUG
  207. >     return mode - mode;
  208.   #else
  209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
  271.       return (ret);
  272.   #endif
  273. > }
  274.   
  275.   #ifdef CRYPTO_MDEBUG

crypto/objects/o_names.c:74:9: 
72.       if (name_funcs_stack == NULL) {
73.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
74. >         name_funcs_stack = sk_NAME_FUNCS_new_null();
75.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
76.       }

crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_new_null()
  2.   
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4. > DEFINE_STACK_OF(NAME_FUNCS)

crypto/stack/stack.c:145:1: start of procedure sk_new_null()
    143.   }
    144.   
    145. > _STACK *sk_new_null(void)
    146.   {
    147.       return sk_new((int (*)(const void *, const void *))0);

crypto/stack/stack.c:147:5: 
    145.   _STACK *sk_new_null(void)
    146.   {
    147. >     return sk_new((int (*)(const void *, const void *))0);
    148.   }
    149.   

crypto/stack/stack.c:150:1: start of procedure sk_new()
      148.   }
      149.   
      150. > _STACK *sk_new(int (*c) (const void *, const void *))
      151.   {
      152.       _STACK *ret;

crypto/stack/stack.c:154:9: 
      152.       _STACK *ret;
      153.   
      154. >     if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
      155.           goto err;
      156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)

crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
        155.   }
        156.   
        157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
        158.   {
        159.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:159:5: 
        157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
        158.   {
        159. >     void *ret = CRYPTO_malloc(num, file, line);
        160.   
        161.       if (ret != NULL)

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
          118.   }
          119.   
          120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
          121.   {
          122.       void *ret = NULL;

crypto/mem.c:122:5: 
          120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
          121.   {
          122. >     void *ret = NULL;
          123.   
          124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
          122.       void *ret = NULL;
          123.   
          124.       if (num <= 0)
                         ^
          125.           return NULL;
          126.   

crypto/mem.c:127:5: 
          125.           return NULL;
          126.   
          127. >     allow_customize = 0;
          128.   #ifdef CRYPTO_MDEBUG
          129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
          135.       }
          136.   #else
          137. >     (void)file;
          138.       (void)line;
          139.       ret = malloc(num);

crypto/mem.c:138:5: 
          136.   #else
          137.       (void)file;
          138. >     (void)line;
          139.       ret = malloc(num);
          140.   #endif

crypto/mem.c:139:5: 
          137.       (void)file;
          138.       (void)line;
          139. >     ret = malloc(num);
          140.   #endif
          141.   

crypto/mem.c:154:5: 
          152.   #endif
          153.   
          154. >     return ret;
          155.   }
          156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
          153.   
          154.       return ret;
          155. > }
          156.   
          157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:161:9: Taking true branch
        159.       void *ret = CRYPTO_malloc(num, file, line);
        160.   
        161.       if (ret != NULL)
                       ^
        162.           memset(ret, 0, num);
        163.       return ret;

crypto/mem.c:162:9: 
        160.   
        161.       if (ret != NULL)
        162. >         memset(ret, 0, num);
        163.       return ret;
        164.   }

crypto/mem.c:163:5: 
        161.       if (ret != NULL)
        162.           memset(ret, 0, num);
        163. >     return ret;
        164.   }
        165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
        162.           memset(ret, 0, num);
        163.       return ret;
        164. > }
        165.   
        166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:154:9: Taking false branch
      152.       _STACK *ret;
      153.   
      154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
                     ^
      155.           goto err;
      156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)

crypto/stack/stack.c:156:9: 
      154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
      155.           goto err;
      156. >     if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
      157.           goto err;
      158.       ret->comp = c;

crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
        155.   }
        156.   
        157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
        158.   {
        159.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:159:5: 
        157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
        158.   {
        159. >     void *ret = CRYPTO_malloc(num, file, line);
        160.   
        161.       if (ret != NULL)

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
          118.   }
          119.   
          120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
          121.   {
          122.       void *ret = NULL;

crypto/mem.c:122:5: 
          120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
          121.   {
          122. >     void *ret = NULL;
          123.   
          124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
          122.       void *ret = NULL;
          123.   
          124.       if (num <= 0)
                         ^
          125.           return NULL;
          126.   

crypto/mem.c:127:5: 
          125.           return NULL;
          126.   
          127. >     allow_customize = 0;
          128.   #ifdef CRYPTO_MDEBUG
          129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
          135.       }
          136.   #else
          137. >     (void)file;
          138.       (void)line;
          139.       ret = malloc(num);

crypto/mem.c:138:5: 
          136.   #else
          137.       (void)file;
          138. >     (void)line;
          139.       ret = malloc(num);
          140.   #endif

crypto/mem.c:139:5: 
          137.       (void)file;
          138.       (void)line;
          139. >     ret = malloc(num);
          140.   #endif
          141.   

crypto/mem.c:154:5: 
          152.   #endif
          153.   
          154. >     return ret;
          155.   }
          156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
          153.   
          154.       return ret;
          155. > }
          156.   
          157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:161:9: Taking true branch
        159.       void *ret = CRYPTO_malloc(num, file, line);
        160.   
        161.       if (ret != NULL)
                       ^
        162.           memset(ret, 0, num);
        163.       return ret;

crypto/mem.c:162:9: 
        160.   
        161.       if (ret != NULL)
        162. >         memset(ret, 0, num);
        163.       return ret;
        164.   }

crypto/mem.c:163:5: 
        161.       if (ret != NULL)
        162.           memset(ret, 0, num);
        163. >     return ret;
        164.   }
        165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
        162.           memset(ret, 0, num);
        163.       return ret;
        164. > }
        165.   
        166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:156:9: Taking false branch
      154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
      155.           goto err;
      156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
                     ^
      157.           goto err;
      158.       ret->comp = c;

crypto/stack/stack.c:158:5: 
      156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
      157.           goto err;
      158. >     ret->comp = c;
      159.       ret->num_alloc = MIN_NODES;
      160.       return (ret);

crypto/stack/stack.c:159:5: 
      157.           goto err;
      158.       ret->comp = c;
      159. >     ret->num_alloc = MIN_NODES;
      160.       return (ret);
      161.   

crypto/stack/stack.c:160:5: 
      158.       ret->comp = c;
      159.       ret->num_alloc = MIN_NODES;
      160. >     return (ret);
      161.   
      162.    err:

crypto/stack/stack.c:165:1: return from a call to sk_new
      163.       OPENSSL_free(ret);
      164.       return (NULL);
      165. > }
      166.   
      167.   int sk_insert(_STACK *st, void *data, int loc)

crypto/stack/stack.c:148:1: return from a call to sk_new_null
    146.   {
    147.       return sk_new((int (*)(const void *, const void *))0);
    148. > }
    149.   
    150.   _STACK *sk_new(int (*c) (const void *, const void *))

crypto/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_new_null
  2.   
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4. > DEFINE_STACK_OF(NAME_FUNCS)

crypto/objects/o_names.c:75:9: 
73.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
74.           name_funcs_stack = sk_NAME_FUNCS_new_null();
75. >         CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
76.       }
77.       if (name_funcs_stack == NULL) {

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
  202.   #endif
  203.   
  204. > int CRYPTO_mem_ctrl(int mode)
  205.   {
  206.   #ifndef CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
  205.   {
  206.   #ifndef CRYPTO_MDEBUG
  207. >     return mode - mode;
  208.   #else
  209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
  271.       return (ret);
  272.   #endif
  273. > }
  274.   
  275.   #ifdef CRYPTO_MDEBUG

crypto/objects/o_names.c:77:9: Taking false branch
75.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
76.       }
77.       if (name_funcs_stack == NULL) {
              ^
78.           /* ERROR */
79.           return (0);

crypto/objects/o_names.c:81:5: 
79.           return (0);
80.       }
81. >     ret = names_type_num;
82.       names_type_num++;
83.       for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {

crypto/objects/o_names.c:82:5: 
80.       }
81.       ret = names_type_num;
82. >     names_type_num++;
83.       for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);

crypto/objects/o_names.c:83:10: 
81.       ret = names_type_num;
82.       names_type_num++;
83. >     for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));

crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_num()
  2.   
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4. > DEFINE_STACK_OF(NAME_FUNCS)

crypto/stack/stack.c:317:1: start of procedure sk_num()
    315.   }
    316.   
    317. > int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)

crypto/stack/stack.c:319:9: Taking false branch
    317.   int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)
                   ^
    320.           return -1;
    321.       return st->num;

crypto/stack/stack.c:321:5: 
    319.       if (st == NULL)
    320.           return -1;
    321. >     return st->num;
    322.   }
    323.   

crypto/stack/stack.c:322:1: return from a call to sk_num
    320.           return -1;
    321.       return st->num;
    322. > }
    323.   
    324.   void *sk_value(const _STACK *st, int i)

crypto/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_num
  2.   
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4. > DEFINE_STACK_OF(NAME_FUNCS)

crypto/objects/o_names.c:83:51: Loop condition is true. Entering loop body
81.       ret = names_type_num;
82.       names_type_num++;
83.       for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
                                                        ^
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));

crypto/objects/o_names.c:84:9: 
82.       names_type_num++;
83.       for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84. >         CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
  202.   #endif
  203.   
  204. > int CRYPTO_mem_ctrl(int mode)
  205.   {
  206.   #ifndef CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
  205.   {
  206.   #ifndef CRYPTO_MDEBUG
  207. >     return mode - mode;
  208.   #else
  209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
  271.       return (ret);
  272.   #endif
  273. > }
  274.   
  275.   #ifdef CRYPTO_MDEBUG

crypto/objects/o_names.c:85:9: 
83.       for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. >         name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87.           if (name_funcs == NULL) {

crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
  155.   }
  156.   
  157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  158.   {
  159.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:159:5: 
  157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  158.   {
  159. >     void *ret = CRYPTO_malloc(num, file, line);
  160.   
  161.       if (ret != NULL)

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
    118.   }
    119.   
    120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122.       void *ret = NULL;

crypto/mem.c:122:5: 
    120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122. >     void *ret = NULL;
    123.   
    124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
    122.       void *ret = NULL;
    123.   
    124.       if (num <= 0)
                   ^
    125.           return NULL;
    126.   

crypto/mem.c:127:5: 
    125.           return NULL;
    126.   
    127. >     allow_customize = 0;
    128.   #ifdef CRYPTO_MDEBUG
    129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
    135.       }
    136.   #else
    137. >     (void)file;
    138.       (void)line;
    139.       ret = malloc(num);

crypto/mem.c:138:5: 
    136.   #else
    137.       (void)file;
    138. >     (void)line;
    139.       ret = malloc(num);
    140.   #endif

crypto/mem.c:139:5: 
    137.       (void)file;
    138.       (void)line;
    139. >     ret = malloc(num);
    140.   #endif
    141.   

crypto/mem.c:154:5: 
    152.   #endif
    153.   
    154. >     return ret;
    155.   }
    156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
    153.   
    154.       return ret;
    155. > }
    156.   
    157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:161:9: Taking true branch
  159.       void *ret = CRYPTO_malloc(num, file, line);
  160.   
  161.       if (ret != NULL)
                 ^
  162.           memset(ret, 0, num);
  163.       return ret;

crypto/mem.c:162:9: 
  160.   
  161.       if (ret != NULL)
  162. >         memset(ret, 0, num);
  163.       return ret;
  164.   }

crypto/mem.c:163:5: 
  161.       if (ret != NULL)
  162.           memset(ret, 0, num);
  163. >     return ret;
  164.   }
  165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
  162.           memset(ret, 0, num);
  163.       return ret;
  164. > }
  165.   
  166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/objects/o_names.c:86:9: 
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86. >         CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87.           if (name_funcs == NULL) {
88.               OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
  202.   #endif
  203.   
  204. > int CRYPTO_mem_ctrl(int mode)
  205.   {
  206.   #ifndef CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
  205.   {
  206.   #ifndef CRYPTO_MDEBUG
  207. >     return mode - mode;
  208.   #else
  209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
  271.       return (ret);
  272.   #endif
  273. > }
  274.   
  275.   #ifdef CRYPTO_MDEBUG

crypto/objects/o_names.c:87:13: Taking false branch
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87.           if (name_funcs == NULL) {
                  ^
88.               OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
89.               return (0);

crypto/objects/o_names.c:91:9: 
89.               return (0);
90.           }
91. >         name_funcs->hash_func = lh_strhash;
92.           name_funcs->cmp_func = OPENSSL_strcmp;
93.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);

crypto/objects/o_names.c:92:9: 
90.           }
91.           name_funcs->hash_func = lh_strhash;
92. >         name_funcs->cmp_func = OPENSSL_strcmp;
93.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94.           sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);

crypto/objects/o_names.c:93:9: 
91.           name_funcs->hash_func = lh_strhash;
92.           name_funcs->cmp_func = OPENSSL_strcmp;
93. >         CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94.           sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
  202.   #endif
  203.   
  204. > int CRYPTO_mem_ctrl(int mode)
  205.   {
  206.   #ifndef CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
  205.   {
  206.   #ifndef CRYPTO_MDEBUG
  207. >     return mode - mode;
  208.   #else
  209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
  271.       return (ret);
  272.   #endif
  273. > }
  274.   
  275.   #ifdef CRYPTO_MDEBUG

crypto/objects/o_names.c:94:9: 
92.           name_funcs->cmp_func = OPENSSL_strcmp;
93.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94. >         sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
96.       }

crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_push()
  2.   
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4. > DEFINE_STACK_OF(NAME_FUNCS)

crypto/stack/stack.c:259:1: start of procedure sk_push()
    257.   }
    258.   
    259. > int sk_push(_STACK *st, void *data)
    260.   {
    261.       return (sk_insert(st, data, st->num));

crypto/stack/stack.c:261:5: 
    259.   int sk_push(_STACK *st, void *data)
    260.   {
    261. >     return (sk_insert(st, data, st->num));
    262.   }
    263.   

crypto/stack/stack.c:167:1: start of procedure sk_insert()
      165.   }
      166.   
      167. > int sk_insert(_STACK *st, void *data, int loc)
      168.   {
      169.       char **s;

crypto/stack/stack.c:171:9: Taking false branch
      169.       char **s;
      170.   
      171.       if (st == NULL)
                     ^
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {

crypto/stack/stack.c:173:9: Taking false branch
      171.       if (st == NULL)
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {
                     ^
      174.           s = OPENSSL_realloc((char *)st->data,
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);

crypto/stack/stack.c:181:10: Taking true branch
      179.           st->num_alloc *= 2;
      180.       }
      181.       if ((loc >= (int)st->num) || (loc < 0))
                      ^
      182.           st->data[st->num] = data;
      183.       else {

crypto/stack/stack.c:182:9: 
      180.       }
      181.       if ((loc >= (int)st->num) || (loc < 0))
      182. >         st->data[st->num] = data;
      183.       else {
      184.           memmove(&(st->data[loc + 1]),

crypto/stack/stack.c:188:5: 
      186.           st->data[loc] = data;
      187.       }
      188. >     st->num++;
      189.       st->sorted = 0;
      190.       return (st->num);

crypto/stack/stack.c:189:5: 
      187.       }
      188.       st->num++;
      189. >     st->sorted = 0;
      190.       return (st->num);
      191.   }

crypto/stack/stack.c:190:5: 
      188.       st->num++;
      189.       st->sorted = 0;
      190. >     return (st->num);
      191.   }
      192.   

crypto/stack/stack.c:191:1: return from a call to sk_insert
      189.       st->sorted = 0;
      190.       return (st->num);
      191. > }
      192.   
      193.   void *sk_delete_ptr(_STACK *st, void *p)

crypto/stack/stack.c:262:1: return from a call to sk_push
    260.   {
    261.       return (sk_insert(st, data, st->num));
    262. > }
    263.   
    264.   int sk_unshift(_STACK *st, void *data)

crypto/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_push
  2.   
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4. > DEFINE_STACK_OF(NAME_FUNCS)

crypto/objects/o_names.c:95:9: 
93.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94.           sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95. >         CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
96.       }
97.       name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
  202.   #endif
  203.   
  204. > int CRYPTO_mem_ctrl(int mode)
  205.   {
  206.   #ifndef CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
  205.   {
  206.   #ifndef CRYPTO_MDEBUG
  207. >     return mode - mode;
  208.   #else
  209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
  271.       return (ret);
  272.   #endif
  273. > }
  274.   
  275.   #ifdef CRYPTO_MDEBUG

crypto/objects/o_names.c:83:71: 
81.       ret = names_type_num;
82.       names_type_num++;
83. >     for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));

crypto/objects/o_names.c:83:51: Loop condition is true. Entering loop body
81.       ret = names_type_num;
82.       names_type_num++;
83.       for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
                                                        ^
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));

crypto/objects/o_names.c:84:9: 
82.       names_type_num++;
83.       for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84. >         CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
  202.   #endif
  203.   
  204. > int CRYPTO_mem_ctrl(int mode)
  205.   {
  206.   #ifndef CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
  205.   {
  206.   #ifndef CRYPTO_MDEBUG
  207. >     return mode - mode;
  208.   #else
  209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
  271.       return (ret);
  272.   #endif
  273. > }
  274.   
  275.   #ifdef CRYPTO_MDEBUG

crypto/objects/o_names.c:85:9: 
83.       for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85. >         name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87.           if (name_funcs == NULL) {

crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
  155.   }
  156.   
  157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  158.   {
  159.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:159:5: 
  157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  158.   {
  159. >     void *ret = CRYPTO_malloc(num, file, line);
  160.   
  161.       if (ret != NULL)

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
    118.   }
    119.   
    120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122.       void *ret = NULL;

crypto/mem.c:122:5: 
    120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122. >     void *ret = NULL;
    123.   
    124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
    122.       void *ret = NULL;
    123.   
    124.       if (num <= 0)
                   ^
    125.           return NULL;
    126.   

crypto/mem.c:127:5: 
    125.           return NULL;
    126.   
    127. >     allow_customize = 0;
    128.   #ifdef CRYPTO_MDEBUG
    129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
    135.       }
    136.   #else
    137. >     (void)file;
    138.       (void)line;
    139.       ret = malloc(num);

crypto/mem.c:138:5: 
    136.   #else
    137.       (void)file;
    138. >     (void)line;
    139.       ret = malloc(num);
    140.   #endif

crypto/mem.c:139:5: 
    137.       (void)file;
    138.       (void)line;
    139. >     ret = malloc(num);
    140.   #endif
    141.   

crypto/mem.c:154:5: 
    152.   #endif
    153.   
    154. >     return ret;
    155.   }
    156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
    153.   
    154.       return ret;
    155. > }
    156.   
    157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:161:9: Taking true branch
  159.       void *ret = CRYPTO_malloc(num, file, line);
  160.   
  161.       if (ret != NULL)
                 ^
  162.           memset(ret, 0, num);
  163.       return ret;

crypto/mem.c:162:9: 
  160.   
  161.       if (ret != NULL)
  162. >         memset(ret, 0, num);
  163.       return ret;
  164.   }

crypto/mem.c:163:5: 
  161.       if (ret != NULL)
  162.           memset(ret, 0, num);
  163. >     return ret;
  164.   }
  165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
  162.           memset(ret, 0, num);
  163.       return ret;
  164. > }
  165.   
  166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/objects/o_names.c:86:9: 
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86. >         CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87.           if (name_funcs == NULL) {
88.               OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
  202.   #endif
  203.   
  204. > int CRYPTO_mem_ctrl(int mode)
  205.   {
  206.   #ifndef CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
  205.   {
  206.   #ifndef CRYPTO_MDEBUG
  207. >     return mode - mode;
  208.   #else
  209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
  271.       return (ret);
  272.   #endif
  273. > }
  274.   
  275.   #ifdef CRYPTO_MDEBUG

crypto/objects/o_names.c:87:13: Taking false branch
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
86.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
87.           if (name_funcs == NULL) {
                  ^
88.               OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
89.               return (0);

crypto/objects/o_names.c:91:9: 
89.               return (0);
90.           }
91. >         name_funcs->hash_func = lh_strhash;
92.           name_funcs->cmp_func = OPENSSL_strcmp;
93.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);

crypto/objects/o_names.c:92:9: 
90.           }
91.           name_funcs->hash_func = lh_strhash;
92. >         name_funcs->cmp_func = OPENSSL_strcmp;
93.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94.           sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);

crypto/objects/o_names.c:93:9: 
91.           name_funcs->hash_func = lh_strhash;
92.           name_funcs->cmp_func = OPENSSL_strcmp;
93. >         CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94.           sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
  202.   #endif
  203.   
  204. > int CRYPTO_mem_ctrl(int mode)
  205.   {
  206.   #ifndef CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
  205.   {
  206.   #ifndef CRYPTO_MDEBUG
  207. >     return mode - mode;
  208.   #else
  209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
  271.       return (ret);
  272.   #endif
  273. > }
  274.   
  275.   #ifdef CRYPTO_MDEBUG

crypto/objects/o_names.c:94:9: 
92.           name_funcs->cmp_func = OPENSSL_strcmp;
93.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94. >         sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
96.       }

crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_push()
  2.   
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4. > DEFINE_STACK_OF(NAME_FUNCS)

crypto/stack/stack.c:259:1: start of procedure sk_push()
    257.   }
    258.   
    259. > int sk_push(_STACK *st, void *data)
    260.   {
    261.       return (sk_insert(st, data, st->num));

crypto/stack/stack.c:261:5: 
    259.   int sk_push(_STACK *st, void *data)
    260.   {
    261. >     return (sk_insert(st, data, st->num));
    262.   }
    263.   

crypto/stack/stack.c:167:1: start of procedure sk_insert()
      165.   }
      166.   
      167. > int sk_insert(_STACK *st, void *data, int loc)
      168.   {
      169.       char **s;

crypto/stack/stack.c:171:9: Taking false branch
      169.       char **s;
      170.   
      171.       if (st == NULL)
                     ^
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {

crypto/stack/stack.c:173:9: Taking false branch
      171.       if (st == NULL)
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {
                     ^
      174.           s = OPENSSL_realloc((char *)st->data,
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);

crypto/stack/stack.c:181:10: Taking true branch
      179.           st->num_alloc *= 2;
      180.       }
      181.       if ((loc >= (int)st->num) || (loc < 0))
                      ^
      182.           st->data[st->num] = data;
      183.       else {

crypto/stack/stack.c:182:9: 
      180.       }
      181.       if ((loc >= (int)st->num) || (loc < 0))
      182. >         st->data[st->num] = data;
      183.       else {
      184.           memmove(&(st->data[loc + 1]),

crypto/stack/stack.c:188:5: 
      186.           st->data[loc] = data;
      187.       }
      188. >     st->num++;
      189.       st->sorted = 0;
      190.       return (st->num);

crypto/stack/stack.c:189:5: 
      187.       }
      188.       st->num++;
      189. >     st->sorted = 0;
      190.       return (st->num);
      191.   }

crypto/stack/stack.c:190:5: 
      188.       st->num++;
      189.       st->sorted = 0;
      190. >     return (st->num);
      191.   }
      192.   

crypto/stack/stack.c:191:1: return from a call to sk_insert
      189.       st->sorted = 0;
      190.       return (st->num);
      191. > }
      192.   
      193.   void *sk_delete_ptr(_STACK *st, void *p)

crypto/stack/stack.c:262:1: return from a call to sk_push
    260.   {
    261.       return (sk_insert(st, data, st->num));
    262. > }
    263.   
    264.   int sk_unshift(_STACK *st, void *data)

crypto/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_push
  2.   
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4. > DEFINE_STACK_OF(NAME_FUNCS)

crypto/objects/o_names.c:95:9: 
93.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
94.           sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
95. >         CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
96.       }
97.       name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);

crypto/mem_dbg.c:204:1: start of procedure CRYPTO_mem_ctrl()
  202.   #endif
  203.   
  204. > int CRYPTO_mem_ctrl(int mode)
  205.   {
  206.   #ifndef CRYPTO_MDEBUG

crypto/mem_dbg.c:207:5: 
  205.   {
  206.   #ifndef CRYPTO_MDEBUG
  207. >     return mode - mode;
  208.   #else
  209.       int ret = mh_mode;

crypto/mem_dbg.c:273:1: return from a call to CRYPTO_mem_ctrl
  271.       return (ret);
  272.   #endif
  273. > }
  274.   
  275.   #ifdef CRYPTO_MDEBUG

crypto/objects/o_names.c:83:71: 
81.       ret = names_type_num;
82.       names_type_num++;
83. >     for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));

crypto/objects/o_names.c:83:51: Loop condition is false. Leaving loop
81.       ret = names_type_num;
82.       names_type_num++;
83.       for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
                                                        ^
84.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
85.           name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));

crypto/objects/o_names.c:97:5: 
95.           CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
96.       }
97. >     name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
98.       if (hash_func != NULL)
99.           name_funcs->hash_func = hash_func;

crypto/objects/o_names.h:4:1: start of procedure sk_NAME_FUNCS_value()
  2.   
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4. > DEFINE_STACK_OF(NAME_FUNCS)

crypto/stack/stack.c:324:1: start of procedure sk_value()
    322.   }
    323.   
    324. > void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:326:10: Taking false branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                    ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:326:17: Taking false branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                           ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:326:28: Taking true branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                                      ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:327:9: 
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
    327. >         return NULL;
    328.       return st->data[i];
    329.   }

crypto/stack/stack.c:329:1: return from a call to sk_value
    327.           return NULL;
    328.       return st->data[i];
    329. > }
    330.   
    331.   void *sk_set(_STACK *st, int i, void *value)

crypto/objects/o_names.h:4:1: return from a call to sk_NAME_FUNCS_value
  2.   
  3.   typedef struct name_funcs_st NAME_FUNCS;
  4. > DEFINE_STACK_OF(NAME_FUNCS)

crypto/objects/o_names.c:98:9: Taking true branch
96.       }
97.       name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
98.       if (hash_func != NULL)
               ^
99.           name_funcs->hash_func = hash_func;
100.       if (cmp_func != NULL)

crypto/objects/o_names.c:99:9: 
97.       name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
98.       if (hash_func != NULL)
99. >         name_funcs->hash_func = hash_func;
100.       if (cmp_func != NULL)
101.           name_funcs->cmp_func = cmp_func;

int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),
                       int (*cmp_func) (const char *, const char *),
                       void (*free_func) (const char *, int, const char *))
{
    int ret;
    int i;
    NAME_FUNCS *name_funcs;
    if (name_funcs_stack == NULL) {
        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
        name_funcs_stack = sk_NAME_FUNCS_new_null();
        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
    }
    if (name_funcs_stack == NULL) {
        return (0);
    }
    ret = names_type_num;
    names_type_num++;
    for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
        name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
        if (name_funcs == NULL) {
            OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
            return (0);
        }
        name_funcs->hash_func = lh_strhash;
        name_funcs->cmp_func = OPENSSL_strcmp;
        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
        sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
    }
    name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
    if (hash_func != NULL)
        name_funcs->hash_func = hash_func;
    if (cmp_func != NULL)
        name_funcs->cmp_func = cmp_func;
    if (free_func != NULL)
        name_funcs->free_func = free_func;
    return (ret);
}
['int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),\n                       int (*cmp_func) (const char *, const char *),\n                       void (*free_func) (const char *, int, const char *))\n{\n    int ret;\n    int i;\n    NAME_FUNCS *name_funcs;\n    if (name_funcs_stack == NULL) {\n        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);\n        name_funcs_stack = sk_NAME_FUNCS_new_null();\n        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);\n    }\n    if (name_funcs_stack == NULL) {\n        return (0);\n    }\n    ret = names_type_num;\n    names_type_num++;\n    for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {\n        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);\n        name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));\n        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);\n        if (name_funcs == NULL) {\n            OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);\n            return (0);\n        }\n        name_funcs->hash_func = lh_strhash;\n        name_funcs->cmp_func = OPENSSL_strcmp;\n        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);\n        sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);\n        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);\n    }\n    name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);\n    if (hash_func != NULL)\n        name_funcs->hash_func = hash_func;\n    if (cmp_func != NULL)\n        name_funcs->cmp_func = cmp_func;\n    if (free_func != NULL)\n        name_funcs->free_func = free_func;\n    return (ret);\n}', 'int CRYPTO_mem_ctrl(int mode)\n{\n#ifndef CRYPTO_MDEBUG\n    return mode - mode;\n#else\n    int ret = mh_mode;\n    CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);\n    switch (mode) {\n    default:\n        break;\n    case CRYPTO_MEM_CHECK_ON:\n        mh_mode = CRYPTO_MEM_CHECK_ON | CRYPTO_MEM_CHECK_ENABLE;\n        num_disable = 0;\n        break;\n    case CRYPTO_MEM_CHECK_OFF:\n        mh_mode = 0;\n        num_disable = 0;\n        break;\n    case CRYPTO_MEM_CHECK_DISABLE:\n        if (mh_mode & CRYPTO_MEM_CHECK_ON) {\n            CRYPTO_THREADID cur;\n            CRYPTO_THREADID_current(&cur);\n            if (!num_disable\n                || CRYPTO_THREADID_cmp(&disabling_threadid, &cur)) {\n                CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);\n                CRYPTO_w_lock(CRYPTO_LOCK_MALLOC2);\n                CRYPTO_w_lock(CRYPTO_LOCK_MALLOC);\n                mh_mode &= ~CRYPTO_MEM_CHECK_ENABLE;\n                CRYPTO_THREADID_cpy(&disabling_threadid, &cur);\n            }\n            num_disable++;\n        }\n        break;\n    case CRYPTO_MEM_CHECK_ENABLE:\n        if (mh_mode & CRYPTO_MEM_CHECK_ON) {\n            if (num_disable) {\n                num_disable--;\n                if (num_disable == 0) {\n                    mh_mode |= CRYPTO_MEM_CHECK_ENABLE;\n                    CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC2);\n                }\n            }\n        }\n        break;\n    }\n    CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC);\n    return (ret);\n#endif\n}', '_STACK *sk_new_null(void)\n{\n    return sk_new((int (*)(const void *, const void *))0);\n}', '_STACK *sk_new(int (*c) (const void *, const void *))\n{\n    _STACK *ret;\n    if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)\n        goto err;\n    if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)\n        goto err;\n    ret->comp = c;\n    ret->num_alloc = MIN_NODES;\n    return (ret);\n err:\n    OPENSSL_free(ret);\n    return (NULL);\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifdef CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}', 'int sk_num(const _STACK *st)\n{\n    if (st == NULL)\n        return -1;\n    return st->num;\n}', 'int sk_push(_STACK *st, void *data)\n{\n    return (sk_insert(st, data, st->num));\n}', 'int sk_insert(_STACK *st, void *data, int loc)\n{\n    char **s;\n    if (st == NULL)\n        return 0;\n    if (st->num_alloc <= st->num + 1) {\n        s = OPENSSL_realloc((char *)st->data,\n                            (unsigned int)sizeof(char *) * st->num_alloc * 2);\n        if (s == NULL)\n            return (0);\n        st->data = s;\n        st->num_alloc *= 2;\n    }\n    if ((loc >= (int)st->num) || (loc < 0))\n        st->data[st->num] = data;\n    else {\n        memmove(&(st->data[loc + 1]),\n                &(st->data[loc]), sizeof(char *) * (st->num - loc));\n        st->data[loc] = data;\n    }\n    st->num++;\n    st->sorted = 0;\n    return (st->num);\n}', 'void *sk_value(const _STACK *st, int i)\n{\n    if (!st || (i < 0) || (i >= st->num))\n        return NULL;\n    return st->data[i];\n}']