Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37836517
en ru br
ALT Linux repos
S:4.19.0-alt3
5.0: 1.7-alt2
4.1: 1.1-alt1
4.0: 1.1-alt1
3.0: 0.2.13-alt1

Group :: System/Libraries
RPM: libtasn1

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: Fix-build-with-gcc12.patch
Download


From 693128a2cda0359dd4c2882b6dd59ef614db9392 Mon Sep 17 00:00:00 2001
From: Mikhail Efremov <sem@altlinux.org>
Date: Thu, 2 Jun 2022 18:33:09 +0300
Subject: [PATCH] Fix build with gcc12
Use assert() to ensure that NULL is not dereferenced.
---
 src/asn1Coding.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/src/asn1Coding.c b/src/asn1Coding.c
index f1869bf..d3951b3 100644
--- a/src/asn1Coding.c
+++ b/src/asn1Coding.c
@@ -311,6 +311,8 @@ main (int argc, char *argv[])
   der_len = 0;
   asn1_result = asn1_der_coding (structure, "", NULL, &der_len,
 				 errorDescription);
+  /* The result must never be success: there is no memory, it just fill the der_len variable */
+  assert (asn1_result != ASN1_SUCCESS);
   if (asn1_result == ASN1_MEM_ERROR)
     {
       der = malloc (der_len);
-- 
2.33.3
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin