X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fasn1pars.c;h=0d6607071fe69b0bc62ffb66a60215344b3a6093;hp=88db0d197835255536554b7f3e35e844310e49a3;hb=e933f91f50108a43c0198cdc63ecdfdbc77b4d0d;hpb=37ead9be0b990b94ec6dbf466cdc05f53c18d442 diff --git a/apps/asn1pars.c b/apps/asn1pars.c index 88db0d1978..0d6607071f 100644 --- a/apps/asn1pars.c +++ b/apps/asn1pars.c @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ -/* A nice addition from Dr Stephen Henson to +/* A nice addition from Dr Stephen Henson to * add the -strparse option which parses nested binary structures */ @@ -94,8 +94,9 @@ int MAIN(int argc, char **argv) char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL; char *genstr=NULL, *genconf=NULL; unsigned char *tmpbuf; + const unsigned char *ctmpbuf; BUF_MEM *buf=NULL; - STACK *osk=NULL; + STACK_OF(OPENSSL_STRING) *osk=NULL; ASN1_TYPE *at=NULL; informat=FORMAT_PEM; @@ -112,7 +113,7 @@ int MAIN(int argc, char **argv) prog=argv[0]; argc--; argv++; - if ((osk=sk_new_null()) == NULL) + if ((osk=sk_OPENSSL_STRING_new_null()) == NULL) { BIO_printf(bio_err,"Memory allocation failure\n"); goto end; @@ -168,7 +169,7 @@ int MAIN(int argc, char **argv) else if (strcmp(*argv,"-strparse") == 0) { if (--argc < 1) goto bad; - sk_push(osk,*(++argv)); + sk_OPENSSL_STRING_push(osk,*(++argv)); } else if (strcmp(*argv,"-genstr") == 0) { @@ -195,7 +196,7 @@ int MAIN(int argc, char **argv) bad: BIO_printf(bio_err,"%s [options] value.asn1_string->data; tmplen=at->value.asn1_string->length; @@ -341,7 +353,7 @@ bad: num -= offset; - if ((length == 0) || (length > num)) length=(unsigned int)num; + if ((length == 0) || ((long)length > num)) length=(unsigned int)num; if(derout) { if(BIO_write(derout, str + offset, length) != (int)length) { BIO_printf(bio_err, "Error writing output\n"); @@ -366,7 +378,7 @@ end: ERR_print_errors(bio_err); if (buf != NULL) BUF_MEM_free(buf); if (at != NULL) ASN1_TYPE_free(at); - if (osk != NULL) sk_free(osk); + if (osk != NULL) sk_OPENSSL_STRING_free(osk); OBJ_cleanup(); apps_shutdown(); OPENSSL_EXIT(ret); @@ -396,6 +408,7 @@ static int do_generate(BIO *bio, char *genstr, char *genconf, BUF_MEM *buf) atyp = ASN1_generate_nconf(genstr, cnf); NCONF_free(cnf); + cnf = NULL; if (!atyp) return -1;