File libtasn1-bsc961491-value-crash.patch of Package libtasn1
From edaff43f27c3e1bcf8317ecee9f733a995602b72 Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Date: Thu, 5 Feb 2015 10:30:14 +0100
Subject: [PATCH] only assign value if the previous node has one
This addresses the crash in the ASN.1 definitions parser
reported in http://lists.gnu.org/archive/html/help-libtasn1/2015-01/msg00000.html
---
lib/parser_aux.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index 4b15000..d3e9009 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -701,9 +701,12 @@ _asn1_expand_object_id (asn1_node node)
p5 =
_asn1_add_single_node (ASN1_ETYPE_CONSTANT);
_asn1_set_name (p5, p4->name);
- tlen = _asn1_strlen (p4->value);
- if (tlen > 0)
- _asn1_set_value (p5, p4->value, tlen + 1);
+ if (p4->value)
+ {
+ tlen = _asn1_strlen (p4->value);
+ if (tlen > 0)
+ _asn1_set_value (p5, p4->value, tlen + 1);
+ }
if (p2 == p)
{
_asn1_set_right (p5, p->down);
--
2.6.2