libtasn1-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU libtasn1 branch, master, updated. libtasn1_4_8-7-g29c03d8


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_4_8-7-g29c03d8
Date: Fri, 3 Jun 2016 04:22:23 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU libtasn1".

http://git.savannah.gnu.org/cgit/libtasn1.git/commit/?id=29c03d88926f5c6f28f90a296ce62f744372a064

The branch, master has been updated
       via  29c03d88926f5c6f28f90a296ce62f744372a064 (commit)
      from  67197e259aa8be1ce2ae4b048e01a9521572fc48 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 29c03d88926f5c6f28f90a296ce62f744372a064
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Jun 3 06:21:25 2016 +0200

    asn1Decoding: Simplified allocation and copy
    
    Based on patch and suggestions by Pascal Cuoq.

-----------------------------------------------------------------------

Summary of changes:
 src/asn1Decoding.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/asn1Decoding.c b/src/asn1Decoding.c
index b52e791..078963e 100644
--- a/src/asn1Decoding.c
+++ b/src/asn1Decoding.c
@@ -142,14 +142,18 @@ main (int argc, char *argv[])
       usage (EXIT_FAILURE);
     }
 
-  inputFileAsnName = (char *) malloc (strlen (argv[optind]) + 1);
-  strcpy (inputFileAsnName, argv[optind]);
+  inputFileAsnName = strdup(argv[optind]);
+  inputFileDerName = strdup(argv[optind + 1]);
+  typeName = strdup(argv[optind + 2]);
 
-  inputFileDerName = (char *) malloc (strlen (argv[optind + 1]) + 1);
-  strcpy (inputFileDerName, argv[optind + 1]);
-
-  typeName = (char *) malloc (strlen (argv[optind + 2]) + 1);
-  strcpy (typeName, argv[optind + 2]);
+  if (!(inputFileAsnName && inputFileDerName && typeName))
+    {
+      fprintf(stderr, "allocation failed\n");
+      free(inputFileAsnName);
+      free(inputFileDerName);
+      free(typeName);
+      exit(1);
+    }
 
   asn1_result =
     asn1_parser2tree (inputFileAsnName, &definitions, errorDescription);


hooks/post-receive
-- 
GNU libtasn1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]