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_9-46-g4c76b01


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_4_9-46-g4c76b01
Date: Thu, 19 Jan 2017 10:13:53 +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=4c76b0138d674864461c3c2463192149e6d66eab

The branch, master has been updated
       via  4c76b0138d674864461c3c2463192149e6d66eab (commit)
       via  403b7f7b8538a54d41f33db52b6e574636157404 (commit)
      from  732d6d8ea317937cf6c2c9a44fb3fa10bff8363e (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 4c76b0138d674864461c3c2463192149e6d66eab
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Jan 19 11:13:48 2017 +0100

    tests: cast to avoid compiler warning

commit 403b7f7b8538a54d41f33db52b6e574636157404
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Thu Jan 19 11:09:19 2017 +0100

    DER decoding: check the return value of _asn1_append_sequence_set
    
    Ensure that the return value of _asn1_append_sequence_set. This
    addresses a potential NULL pointer dereference.
    
    Signed-off-by: Nikos Mavrogiannopoulos <address@hidden>

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

Summary of changes:
 lib/decoding.c              |   23 ++++++++++++++++++++---
 lib/element.c               |    2 +-
 tests/ocsp-basic-response.c |    2 +-
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/lib/decoding.c b/lib/decoding.c
index c2e6027..2abff57 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -1305,7 +1305,12 @@ asn1_der_decoding2 (asn1_node *element, const void 
*ider, int *max_ider_len,
                    {           /* indefinite length method */
                      if (!HAVE_TWO(ider_len) || ((der[counter]) || der[counter 
+ 1]))
                        {
-                         _asn1_append_sequence_set (p, &tcache);
+                         result = _asn1_append_sequence_set (p, &tcache);
+                         if (result != 0)
+                           {
+                              warn();
+                             goto cleanup;
+                           }
                          p = tcache.tail;
                          move = RIGHT;
                          continue;
@@ -1321,7 +1326,12 @@ asn1_der_decoding2 (asn1_node *element, const void 
*ider, int *max_ider_len,
                    {           /* definite length method */
                      if (len2 > counter)
                        {
-                         _asn1_append_sequence_set (p, &tcache);
+                         result = _asn1_append_sequence_set (p, &tcache);
+                         if (result != 0)
+                           {
+                              warn();
+                             goto cleanup;
+                           }
                          p = tcache.tail;
                          move = RIGHT;
                          continue;
@@ -1375,7 +1385,14 @@ asn1_der_decoding2 (asn1_node *element, const void 
*ider, int *max_ider_len,
                             || (type_field (p2->type) == ASN1_ETYPE_SIZE))
                        p2 = p2->right;
                      if (p2->right == NULL)
-                       _asn1_append_sequence_set (p, &tcache);
+                       {
+                         result = _asn1_append_sequence_set (p, &tcache);
+                         if (result != 0)
+                           {
+                              warn();
+                             goto cleanup;
+                           }
+                       }
                      p = p2;
                    }
                }
diff --git a/lib/element.c b/lib/element.c
index 756e41a..b09f826 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -128,7 +128,7 @@ _asn1_convert_integer (const unsigned char *value, unsigned 
char *value_out,
   return ASN1_SUCCESS;
 }
 
-/* Appends a new element into the sequent (or set) defined by this
+/* Appends a new element into the sequence (or set) defined by this
  * node. The new element will have a name of '?number', where number
  * is a monotonically increased serial number.
  *
diff --git a/tests/ocsp-basic-response.c b/tests/ocsp-basic-response.c
index 18ec394..3a190a8 100644
--- a/tests/ocsp-basic-response.c
+++ b/tests/ocsp-basic-response.c
@@ -96,7 +96,7 @@ main (int argc, char** argv)
 
   if (etype != ASN1_ETYPE_OCTET_STRING)
     {
-      fprintf (stderr, "error in %d: The type (%d) doesn't match octet 
string.\n", __LINE__, etype);
+      fprintf (stderr, "error in %d: The type (%d) doesn't match octet 
string.\n", __LINE__, (int)etype);
       exit (1);
     }
 


hooks/post-receive
-- 
GNU libtasn1



reply via email to

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