Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37838097
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-tests-build-with-glibc-2.38.patch
Download


From 4b28eaa7bd505129589febd3433d23ea7e289a28 Mon Sep 17 00:00:00 2001
From: Mikhail Efremov <sem@altlinux.org>
Date: Wed, 23 Aug 2023 17:40:42 +0300
Subject: [PATCH] Fix tests build with glibc 2.38
Fixed warning:
use of possibly-NULL where non-null expected [CWE-690]
[-Werror=analyzer-possible-null-argument].
---
 tests/Test_parser.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/Test_parser.c b/tests/Test_parser.c
index b0b4e7a..3bf53a9 100644
--- a/tests/Test_parser.c
+++ b/tests/Test_parser.c
@@ -146,6 +146,8 @@ createFile (int lineNumber, const char *line)
 
   fileIn = fopen (fileCorrectName, "r");
   fileOut = fopen (fileErroredName, "w");
+  if (fileIn == NULL || fileOut == NULL)
+    goto out;
 
   while (readLine (fileIn, lineRead) != EOF)
     {
@@ -156,8 +158,11 @@ createFile (int lineNumber, const char *line)
 	fprintf (fileOut, "%s\n", lineRead);
     }
 
-  fclose (fileOut);
-  fclose (fileIn);
+out:
+  if (fileOut)
+    fclose (fileOut);
+  if (fileIn)
+    fclose (fileIn);
 }
 
 static int
-- 
2.33.8
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin