Blame SOURCES/0001-tctildr-fix-segmentation-fault-if-name_conf-is-too-b.patch

e56592
From ffca561b2de43df0a9f7f9c0e717fca943f2c38b Mon Sep 17 00:00:00 2001
e56592
From: Johannes Holland <joh.ho@gmx.de>
e56592
Date: Tue, 20 Aug 2019 16:58:09 +0200
e56592
Subject: [PATCH] tctildr: fix segmentation fault if name_conf is too big
e56592
e56592
When strlen(name_conf) is too big and logging is set to at least DEBUG,
e56592
tctildr_conf_parse will cause a segmentation fault. This happens when
e56592
the unit tests are run with logging set to DEBUG. Hence, the logging
e56592
call has to be done after the check for strlen(name_conf).
e56592
e56592
Signed-off-by: Johannes Holland <joh.ho@gmx.de>
e56592
---
e56592
 src/tss2-tcti/tctildr.c | 3 ++-
e56592
 1 file changed, 2 insertions(+), 1 deletion(-)
e56592
e56592
diff --git a/src/tss2-tcti/tctildr.c b/src/tss2-tcti/tctildr.c
e56592
index 76248f358860..ff967317b57b 100644
e56592
--- a/src/tss2-tcti/tctildr.c
e56592
+++ b/src/tss2-tcti/tctildr.c
e56592
@@ -117,7 +117,6 @@ tctildr_conf_parse (const char *name_conf,
e56592
     char *split;
e56592
     size_t combined_length;
e56592
 
e56592
-    LOG_DEBUG ("name_conf: \"%s\"", name_conf);
e56592
     if (name_conf == NULL) {
e56592
         LOG_ERROR ("'name_conf' param may NOT be NULL");
e56592
         return TSS2_TCTI_RC_BAD_REFERENCE;
e56592
@@ -127,6 +126,8 @@ tctildr_conf_parse (const char *name_conf,
e56592
         LOG_ERROR ("combined conf length must be between 0 and PATH_MAX");
e56592
         return TSS2_TCTI_RC_BAD_VALUE;
e56592
     }
e56592
+
e56592
+    LOG_DEBUG ("name_conf: \"%s\"", name_conf);
e56592
     if (combined_length == 0)
e56592
         return TSS2_RC_SUCCESS;
e56592
     split = strchr (name_conf, ':');
e56592
-- 
e56592
2.27.0
e56592