apps/apps.c:1022: error: NULL_DEREFERENCE
  pointer `null` is dereferenced by call to `X509_NAME_oneline()` at line 1022, column 15.
Showing all 36 steps of the trace


apps/apps.c:1008:1: start of procedure print_name()
1006.   }
1007.   
1008. > void print_name(BIO *out, const char *title, X509_NAME *nm,
1009.                   unsigned long lflags)
1010.   {

apps/apps.c:1012:5: 
1010.   {
1011.       char *buf;
1012. >     char mline = 0;
1013.       int indent = 0;
1014.   

apps/apps.c:1013:5: 
1011.       char *buf;
1012.       char mline = 0;
1013. >     int indent = 0;
1014.   
1015.       if (title)

apps/apps.c:1015:9: Taking true branch
1013.       int indent = 0;
1014.   
1015.       if (title)
                ^
1016.           BIO_puts(out, title);
1017.       if ((lflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {

apps/apps.c:1016:9: 
1014.   
1015.       if (title)
1016. >         BIO_puts(out, title);
1017.       if ((lflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
1018.           mline = 1;

crypto/bio/bio_lib.c:387:1: start of procedure BIO_puts()
  385.   }
  386.   
  387. > int BIO_puts(BIO *b, const char *buf)
  388.   {
  389.       int ret;

crypto/bio/bio_lib.c:390:5: 
  388.   {
  389.       int ret;
  390. >     size_t written = 0;
  391.   
  392.       if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) {

crypto/bio/bio_lib.c:392:10: Taking false branch
  390.       size_t written = 0;
  391.   
  392.       if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) {
                  ^
  393.           BIOerr(BIO_F_BIO_PUTS, BIO_R_UNSUPPORTED_METHOD);
  394.           return -2;

crypto/bio/bio_lib.c:392:25: Taking false branch
  390.       size_t written = 0;
  391.   
  392.       if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) {
                                 ^
  393.           BIOerr(BIO_F_BIO_PUTS, BIO_R_UNSUPPORTED_METHOD);
  394.           return -2;

crypto/bio/bio_lib.c:392:48: Taking false branch
  390.       size_t written = 0;
  391.   
  392.       if ((b == NULL) || (b->method == NULL) || (b->method->bputs == NULL)) {
                                                        ^
  393.           BIOerr(BIO_F_BIO_PUTS, BIO_R_UNSUPPORTED_METHOD);
  394.           return -2;

crypto/bio/bio_lib.c:397:9: Taking false branch
  395.       }
  396.   
  397.       if (b->callback != NULL || b->callback_ex != NULL) {
                 ^
  398.           ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
  399.           if (ret <= 0)

crypto/bio/bio_lib.c:397:32: Taking false branch
  395.       }
  396.   
  397.       if (b->callback != NULL || b->callback_ex != NULL) {
                                        ^
  398.           ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
  399.           if (ret <= 0)

crypto/bio/bio_lib.c:403:10: Taking false branch
  401.       }
  402.   
  403.       if (!b->init) {
                  ^
  404.           BIOerr(BIO_F_BIO_PUTS, BIO_R_UNINITIALIZED);
  405.           return -2;

crypto/bio/bio_lib.c:408:5: Skipping __function_pointer__(): unresolved function pointer
  406.       }
  407.   
  408.       ret = b->method->bputs(b, buf);
             ^
  409.   
  410.       if (ret > 0) {

crypto/bio/bio_lib.c:410:9: Taking false branch
  408.       ret = b->method->bputs(b, buf);
  409.   
  410.       if (ret > 0) {
                 ^
  411.           b->num_write += (uint64_t)ret;
  412.           written = ret;

crypto/bio/bio_lib.c:416:9: Taking false branch
  414.       }
  415.   
  416.       if (b->callback != NULL || b->callback_ex != NULL)
                 ^
  417.           ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  418.                                        0L, ret, &written);

crypto/bio/bio_lib.c:416:32: Taking false branch
  414.       }
  415.   
  416.       if (b->callback != NULL || b->callback_ex != NULL)
                                        ^
  417.           ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
  418.                                        0L, ret, &written);

crypto/bio/bio_lib.c:420:9: Taking false branch
  418.                                        0L, ret, &written);
  419.   
  420.       if (ret > 0) {
                 ^
  421.           if (written > INT_MAX) {
  422.               BIOerr(BIO_F_BIO_PUTS, BIO_R_LENGTH_TOO_LONG);

crypto/bio/bio_lib.c:429:5: 
  427.       }
  428.   
  429. >     return ret;
  430.   }
  431.   

crypto/bio/bio_lib.c:430:1: return from a call to BIO_puts
  428.   
  429.       return ret;
  430. > }
  431.   
  432.   int BIO_gets(BIO *b, char *buf, int size)

apps/apps.c:1017:9: Taking true branch
1015.       if (title)
1016.           BIO_puts(out, title);
1017.       if ((lflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
                ^
1018.           mline = 1;
1019.           indent = 4;

apps/apps.c:1018:9: 
1016.           BIO_puts(out, title);
1017.       if ((lflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
1018. >         mline = 1;
1019.           indent = 4;
1020.       }

apps/apps.c:1019:9: 
1017.       if ((lflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
1018.           mline = 1;
1019. >         indent = 4;
1020.       }
1021.       if (lflags == XN_FLAG_COMPAT) {

apps/apps.c:1021:9: Taking true branch
1019.           indent = 4;
1020.       }
1021.       if (lflags == XN_FLAG_COMPAT) {
                ^
1022.           buf = X509_NAME_oneline(nm, 0, 0);
1023.           BIO_puts(out, buf);

apps/apps.c:1022:9: 
1020.       }
1021.       if (lflags == XN_FLAG_COMPAT) {
1022. >         buf = X509_NAME_oneline(nm, 0, 0);
1023.           BIO_puts(out, buf);
1024.           BIO_puts(out, "\n");

crypto/x509/x509_obj.c:24:1: start of procedure X509_NAME_oneline()
  22.   #define NAME_ONELINE_MAX    (1024 * 1024)
  23.   
  24. > char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
  25.   {
  26.       const X509_NAME_ENTRY *ne;

crypto/x509/x509_obj.c:32:5: 
  30.       char *p;
  31.       unsigned char *q;
  32. >     BUF_MEM *b = NULL;
  33.       static const char hex[17] = "0123456789ABCDEF";
  34.       int gs_doit[4];

crypto/x509/x509_obj.c:33:5: 
  31.       unsigned char *q;
  32.       BUF_MEM *b = NULL;
  33. >     static const char hex[17] = "0123456789ABCDEF";
  34.       int gs_doit[4];
  35.       char tmp_buf[80];

crypto/x509/x509_obj.c:40:9: Taking false branch
  38.   #endif
  39.   
  40.       if (buf == NULL) {
                ^
  41.           if ((b = BUF_MEM_new()) == NULL)
  42.               goto err;

crypto/x509/x509_obj.c:47:16: Taking false branch
  45.           b->data[0] = '\0';
  46.           len = 200;
  47.       } else if (len == 0) {
                       ^
  48.           return NULL;
  49.       }

crypto/x509/x509_obj.c:50:9: Taking true branch
  48.           return NULL;
  49.       }
  50.       if (a == NULL) {
                ^
  51.           if (b) {
  52.               buf = b->data;

crypto/x509/x509_obj.c:51:13: Taking false branch
  49.       }
  50.       if (a == NULL) {
  51.           if (b) {
                    ^
  52.               buf = b->data;
  53.               OPENSSL_free(b);

crypto/x509/x509_obj.c:55:9: 
  53.               OPENSSL_free(b);
  54.           }
  55. >         strncpy(buf, "NO X509_NAME", len);
  56.           buf[len - 1] = '\0';
  57.           return buf;

crypto/x509/x509_obj.c:56:9: 
  54.           }
  55.           strncpy(buf, "NO X509_NAME", len);
  56. >         buf[len - 1] = '\0';
  57.           return buf;
  58.       }

crypto/x509/x509_obj.c:57:9: 
  55.           strncpy(buf, "NO X509_NAME", len);
  56.           buf[len - 1] = '\0';
  57. >         return buf;
  58.       }
  59.   

crypto/x509/x509_obj.c:181:1: return from a call to X509_NAME_oneline
  179.       BUF_MEM_free(b);
  180.       return NULL;
  181. > }
