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

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Thu Jul 18 17:10:47 CEST 2019




Tim Rühsen started a new discussion on src/asn1Coding.c: https://gitlab.com/gnutls/libtasn1/merge_requests/20#note_193365759

>  	  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);

In general we should use exit (EXIT_...).

I believe we need a full code review at some point...

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/libtasn1/merge_requests/20#note_193365759
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/b4b6ffab/attachment.html>


More information about the Gnutls-devel mailing list