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_2_13-26-g5d80448


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_2_13-26-g5d80448
Date: Fri, 14 Sep 2012 16:08:26 +0000

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=5d8044833ffaa6bbf9591956f216a1eb749bdef7

The branch, master has been updated
       via  5d8044833ffaa6bbf9591956f216a1eb749bdef7 (commit)
       via  fde3a0605bf8a6260618290b72f79c5d93ce135b (commit)
       via  6c118ee8764593d0217a6ae590a2cf2e2edb7602 (commit)
      from  6e896a8e7c30d3351f874731835f803cb1edd155 (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 5d8044833ffaa6bbf9591956f216a1eb749bdef7
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Sep 14 18:08:19 2012 +0200

    Corrected the test.

commit fde3a0605bf8a6260618290b72f79c5d93ce135b
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Sep 14 18:08:10 2012 +0200

    name has size of ASN1_MAX_NAME_SIZE+1 to allow for a terminating null.

commit 6c118ee8764593d0217a6ae590a2cf2e2edb7602
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Fri Sep 14 17:58:53 2012 +0200

    removed unneeded casts

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

Summary of changes:
 lib/ASN1.c          |    4 ++--
 lib/ASN1.y          |    4 ++--
 lib/int.h           |    2 +-
 tests/Test_parser.c |    8 +++-----
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/lib/ASN1.c b/lib/ASN1.c
index 5289e6a..b6a5844 100644
--- a/lib/ASN1.c
+++ b/lib/ASN1.c
@@ -2944,7 +2944,7 @@ int asn1_parser2array(const char *inputFileName,const 
char *outputFileName,
 
        if(outputFileName == NULL){
          /* file_out_name = inputFileName + _asn1_tab.c */
-         file_out_name=(char *)malloc(dot_p-inputFileName+1+
+         file_out_name=malloc(dot_p-inputFileName+1+
                                       strlen("_asn1_tab.c"));
          memcpy(file_out_name,inputFileName,dot_p-inputFileName);
          file_out_name[dot_p-inputFileName]=0;
@@ -2958,7 +2958,7 @@ int asn1_parser2array(const char *inputFileName,const 
char *outputFileName,
 
        if(vectorName == NULL){
          /* vector_name = file name + _asn1_tab */
-         vector_name=(char *)malloc(dot_p-slash_p+1+
+         vector_name=malloc(dot_p-slash_p+1+
                                     strlen("_asn1_tab"));
          memcpy(vector_name,slash_p,dot_p-slash_p);
          vector_name[dot_p-slash_p]=0;
diff --git a/lib/ASN1.y b/lib/ASN1.y
index 0611e85..66173ea 100644
--- a/lib/ASN1.y
+++ b/lib/ASN1.y
@@ -710,7 +710,7 @@ int asn1_parser2array(const char *inputFileName,const char 
*outputFileName,
 
        if(outputFileName == NULL){
          /* file_out_name = inputFileName + _asn1_tab.c */
-         file_out_name=(char *)malloc(dot_p-inputFileName+1+
+         file_out_name=malloc(dot_p-inputFileName+1+
                                       strlen("_asn1_tab.c"));
          memcpy(file_out_name,inputFileName,dot_p-inputFileName);
          file_out_name[dot_p-inputFileName]=0;
@@ -724,7 +724,7 @@ int asn1_parser2array(const char *inputFileName,const char 
*outputFileName,
 
        if(vectorName == NULL){
          /* vector_name = file name + _asn1_tab */
-         vector_name=(char *)malloc(dot_p-slash_p+1+
+         vector_name=malloc(dot_p-slash_p+1+
                                     strlen("_asn1_tab"));
          memcpy(vector_name,slash_p,dot_p-slash_p);
          vector_name[dot_p-slash_p]=0;
diff --git a/lib/int.h b/lib/int.h
index 65e3c0e..fad4dbe 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -46,7 +46,7 @@
 struct node_asn_struct
 {
   /* public fields: */
-  char name[ASN1_MAX_NAME_SIZE];                       /* Node name */
+  char name[ASN1_MAX_NAME_SIZE+1];                     /* Node name */
   unsigned int type;           /* Node type */
   unsigned char *value;                /* Node value */
   int value_len;
diff --git a/tests/Test_parser.c b/tests/Test_parser.c
index 76daf09..fd56210 100644
--- a/tests/Test_parser.c
+++ b/tests/Test_parser.c
@@ -52,13 +52,12 @@ test_type test_array[] = {
 
   /* Test ASN1_MAX_NAME_SIZE (128) */
   {12,
-   
"a1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
 ::= INTEGER",
+   "a123456789012345678901234567890123456789012345678901234567890123 ::= 
INTEGER",
    ASN1_SUCCESS, ""},
   {12,
-   
"a12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
 ::= INTEGER",
+   "a1234567890123456789012345678901234567890123456789012345678901234 ::= 
INTEGER",
    ASN1_NAME_TOO_LONG,
-   _FILE_ ":12: name too long (more than 128 characters)"},
-
+   _FILE_ ":12: name too long (more than 64 characters)"},
   /* Test 'check identifier' function */
   {12, "ident1 ::= ident2   ident2 ::= INTEGER",
    ASN1_SUCCESS, ""},
@@ -101,7 +100,6 @@ test_type test_array[] = {
   {20, "   oid1    OBJECT IDENTIFIER DEFAULT Oid-type1",
    ASN1_SUCCESS, ""},
 
-
   /* end */
   {0}
 };


hooks/post-receive
-- 
GNU libtasn1



reply via email to

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