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.7-9-gbd6f377


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU libtasn1 branch, master, updated. libtasn1_4.7-9-gbd6f377
Date: Mon, 29 Feb 2016 09:41:10 +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=bd6f37713d139b5d102df70248ee9af3422f0339

The branch, master has been updated
       via  bd6f37713d139b5d102df70248ee9af3422f0339 (commit)
       via  dd215e40f1f1c499359fb09e9cfd856b125413e2 (commit)
      from  0d42c018d1031e1e87263c85b02e13037bd958d1 (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 bd6f37713d139b5d102df70248ee9af3422f0339
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Feb 29 10:40:00 2016 +0100

    .gitlab-ci.yml: added libubsan builds

commit dd215e40f1f1c499359fb09e9cfd856b125413e2
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Mon Feb 29 10:39:17 2016 +0100

    coding: Fixes to prevent undefined behavior (found with libubsan)

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

Summary of changes:
 .gitlab-ci.yml |    8 ++++++++
 lib/coding.c   |    8 +++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 553bb76..e98955e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,3 +10,11 @@ Build and Check with asan:
     -O2" LDFLAGS="-static-libasan" ./configure --disable-doc 
--disable-valgrind-tests && make -j4 && make check -j4
   except:
   - tags
+Build and Check with ubsan:
+  script:
+  - git submodule update --init && make autoreconf && 
CFLAGS="-fsanitize=undefined -fno-sanitize-recover -g
+    -O2" LDFLAGS="-static-libubsan" ./configure --disable-doc 
--disable-valgrind-tests && make -j4 && make check -j4
+  tags:
+  - ubsan
+  except:
+  - tags
diff --git a/lib/coding.c b/lib/coding.c
index b23ca16..78615a1 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -443,7 +443,9 @@ asn1_bit_der (const unsigned char *str, int bit_len,
     len_byte++;
   asn1_length_der (len_byte + 1, der, &len_len);
   der[len_len] = len_pad;
-  memcpy (der + len_len + 1, str, len_byte);
+
+  if (str)
+    memcpy (der + len_len + 1, str, len_byte);
   der[len_len + len_byte] &= bit_mask[len_pad];
   *der_len = len_byte + len_len + 1;
 }
@@ -628,7 +630,7 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, 
int *counter,
                                   tag_der, &tag_len);
 
                  *max_len -= tag_len;
-                 if (*max_len >= 0)
+                 if (der && *max_len >= 0)
                    memcpy (der + *counter, tag_der, tag_len);
                  *counter += tag_len;
 
@@ -680,7 +682,7 @@ _asn1_insert_tag_der (asn1_node node, unsigned char *der, 
int *counter,
     }
 
   *max_len -= tag_len;
-  if (*max_len >= 0)
+  if (der && *max_len >= 0)
     memcpy (der + *counter, tag_der, tag_len);
   *counter += tag_len;
 


hooks/post-receive
-- 
GNU libtasn1



reply via email to

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