apps/srp.c:112: error: NULL_DEREFERENCE
  pointer `pp` last assigned on line 111 could be null and is dereferenced at line 112, column 47.
Showing all 11 steps of the trace


apps/srp.c:107:1: start of procedure print_entry()
105.   }
106.   
107. > static void print_entry(CA_DB *db, int indx, int verbose, char *s)
108.   {
109.       if (indx >= 0 && verbose) {

apps/srp.c:109:9: Taking true branch
107.   static void print_entry(CA_DB *db, int indx, int verbose, char *s)
108.   {
109.       if (indx >= 0 && verbose) {
               ^
110.           int j;
111.           char **pp = sk_OPENSSL_PSTRING_value(db->db->data, indx);

apps/srp.c:109:22: Taking true branch
107.   static void print_entry(CA_DB *db, int indx, int verbose, char *s)
108.   {
109.       if (indx >= 0 && verbose) {
                            ^
110.           int j;
111.           char **pp = sk_OPENSSL_PSTRING_value(db->db->data, indx);

apps/srp.c:111:9: 
109.       if (indx >= 0 && verbose) {
110.           int j;
111. >         char **pp = sk_OPENSSL_PSTRING_value(db->db->data, indx);
112.           BIO_printf(bio_err, "%s \"%s\"\n", s, pp[DB_srpid]);
113.           for (j = 0; j < DB_NUMBER; j++) {

include/openssl/txt_db.h:79:1: start of procedure sk_OPENSSL_PSTRING_value()
  77.   
  78.   typedef OPENSSL_STRING *OPENSSL_PSTRING;
  79. > DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING)
  80.   
  81.   typedef struct txt_db_st {

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

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

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

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

include/openssl/txt_db.h:79:1: return from a call to sk_OPENSSL_PSTRING_value
  77.   
  78.   typedef OPENSSL_STRING *OPENSSL_PSTRING;
  79. > DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING)
  80.   
  81.   typedef struct txt_db_st {

apps/srp.c:112:9: 
110.           int j;
111.           char **pp = sk_OPENSSL_PSTRING_value(db->db->data, indx);
112. >         BIO_printf(bio_err, "%s \"%s\"\n", s, pp[DB_srpid]);
113.           for (j = 0; j < DB_NUMBER; j++) {
114.               BIO_printf(bio_err, "  %d = \"%s\"\n", j, pp[j]);

static void print_entry(CA_DB *db, int indx, int verbose, char *s)
{
    if (indx >= 0 && verbose) {
        int j;
        char **pp = sk_OPENSSL_PSTRING_value(db->db->data, indx);
        BIO_printf(bio_err, "%s \"%s\"\n", s, pp[DB_srpid]);
        for (j = 0; j < DB_NUMBER; j++) {
            BIO_printf(bio_err, "  %d = \"%s\"\n", j, pp[j]);
        }
    }
}
['static void print_entry(CA_DB *db, int indx, int verbose, char *s)\n{\n    if (indx >= 0 && verbose) {\n        int j;\n        char **pp = sk_OPENSSL_PSTRING_value(db->db->data, indx);\n        BIO_printf(bio_err, "%s \\"%s\\"\\n", s, pp[DB_srpid]);\n        for (j = 0; j < DB_NUMBER; j++) {\n            BIO_printf(bio_err, "  %d = \\"%s\\"\\n", j, pp[j]);\n        }\n    }\n}', 'DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING)', '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}']