[BACK]Return to ca.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / openssl

Diff for /src/usr.bin/openssl/ca.c between version 1.39 and 1.40

version 1.39, 2021/08/28 04:02:20 version 1.40, 2021/08/28 05:14:30
Line 2247 
Line 2247 
         row[DB_type] = malloc(2);          row[DB_type] = malloc(2);
   
         tm = X509_get_notAfter(ret);          tm = X509_get_notAfter(ret);
         row[DB_exp_date] = malloc(tm->length + 1);          row[DB_exp_date] = strndup(tm->data, tm->length);
         if (row[DB_type] == NULL || row[DB_exp_date] == NULL) {          if (row[DB_type] == NULL || row[DB_exp_date] == NULL) {
                 BIO_printf(bio_err, "Memory allocation failure\n");                  BIO_printf(bio_err, "Memory allocation failure\n");
                 goto err;                  goto err;
         }          }
   
         memcpy(row[DB_exp_date], tm->data, tm->length);  
         row[DB_exp_date][tm->length] = '\0';  
   
         row[DB_rev_date] = NULL;          row[DB_rev_date] = NULL;
   
         /* row[DB_serial] done already */          /* row[DB_serial] done already */
Line 2507 
Line 2504 
                 row[DB_type] = malloc(2);                  row[DB_type] = malloc(2);
   
                 tm = X509_get_notAfter(x509);                  tm = X509_get_notAfter(x509);
                 row[DB_exp_date] = malloc(tm->length + 1);                  row[DB_exp_date] = strndup(tm->data, tm->length);
                 if (row[DB_type] == NULL || row[DB_exp_date] == NULL) {                  if (row[DB_type] == NULL || row[DB_exp_date] == NULL) {
                         BIO_printf(bio_err, "Memory allocation failure\n");                          BIO_printf(bio_err, "Memory allocation failure\n");
                         goto err;                          goto err;
                 }                  }
                 memcpy(row[DB_exp_date], tm->data, tm->length);  
                 row[DB_exp_date][tm->length] = '\0';  
   
                 row[DB_rev_date] = NULL;                  row[DB_rev_date] = NULL;
   
Line 2673 
Line 2668 
                 cnt = -1;                  cnt = -1;
                 goto err;                  goto err;
         }          }
         a_tm_s = malloc(a_tm->length + 1);          a_tm_s = strndup(a_tm->data, a_tm->length);
         if (a_tm_s == NULL) {          if (a_tm_s == NULL) {
                 cnt = -1;                  cnt = -1;
                 goto err;                  goto err;
         }          }
         memcpy(a_tm_s, a_tm->data, a_tm->length);  
         a_tm_s[a_tm->length] = '\0';  
   
         if (strncmp(a_tm_s, "49", 2) <= 0)          if (strncmp(a_tm_s, "49", 2) <= 0)
                 a_y2k = 1;                  a_y2k = 1;

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40