[gnutls-devel] libtasn1 | Minor fixes in apps (!20)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Thu Jul 18 21:00:25 CEST 2019




Nikos Mavrogiannopoulos commented on a discussion on src/asn1Coding.c: https://gitlab.com/gnutls/libtasn1/merge_requests/20#note_193439507

>  	  checkSyntaxOnly = 1;
>  	  break;
>  	case 'o':		/* OUTPUT */
> -	  outputFileName = (char *) malloc (strlen (optarg) + 1);
> -	  strcpy (outputFileName, optarg);
> +	  assert(optarg != NULL);
> +	  outputFileName = strdup(optarg);
> +	  if (outputFileName == NULL)
> +	    {
> +	      fprintf(stderr, "Memory error\n");
> +	      exit(1);

I'm following what is already there. I have no opinion for 0 vs EXIT_SUCCESS.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/libtasn1/merge_requests/20#note_193439507
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190718/2e2a7d2f/attachment.html>


More information about the Gnutls-devel mailing list