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

Diff for /src/usr.bin/openssl/apps.c between version 1.64 and 1.65

version 1.64, 2023/04/22 20:50:26 version 1.65, 2023/06/11 12:35:00
Line 200 
Line 200 
 }  }
   
 int  int
 chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])  
 {  
         int num, i;  
         char *p;  
   
         *argc = 0;  
         *argv = NULL;  
   
         if (arg->count == 0) {  
                 arg->count = 20;  
                 arg->data = reallocarray(NULL, arg->count, sizeof(char *));  
                 if (arg->data == NULL)  
                         return 0;  
         }  
         for (i = 0; i < arg->count; i++)  
                 arg->data[i] = NULL;  
   
         num = 0;  
         p = buf;  
         for (;;) {  
                 /* first scan over white space */  
                 if (!*p)  
                         break;  
                 while (*p && ((*p == ' ') || (*p == '\t') || (*p == '\n')))  
                         p++;  
                 if (!*p)  
                         break;  
   
                 /* The start of something good :-) */  
                 if (num >= arg->count) {  
                         char **tmp_p;  
                         int tlen = arg->count + 20;  
                         tmp_p = reallocarray(arg->data, tlen, sizeof(char *));  
                         if (tmp_p == NULL)  
                                 return 0;  
                         arg->data = tmp_p;  
                         arg->count = tlen;  
                         /* initialize newly allocated data */  
                         for (i = num; i < arg->count; i++)  
                                 arg->data[i] = NULL;  
                 }  
                 arg->data[num++] = p;  
   
                 /* now look for the end of this */  
                 if ((*p == '\'') || (*p == '\"')) {     /* scan for closing  
                                                          * quote */  
                         i = *(p++);  
                         arg->data[num - 1]++;   /* jump over quote */  
                         while (*p && (*p != i))  
                                 p++;  
                         *p = '\0';  
                 } else {  
                         while (*p && ((*p != ' ') &&  
                             (*p != '\t') && (*p != '\n')))  
                                 p++;  
   
                         if (*p == '\0')  
                                 p--;  
                         else  
                                 *p = '\0';  
                 }  
                 p++;  
         }  
         *argc = num;  
         *argv = arg->data;  
         return (1);  
 }  
   
 int  
 dump_cert_text(BIO *out, X509 *x)  dump_cert_text(BIO *out, X509 *x)
 {  {
         char *p;          char *p;

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65