pam/4fbed4be20377e5b1a6e71f572eb28ed049ed3fe.patch
2024-05-28 04:43:18 +03:00

23 lines
742 B
Diff

From 4fbed4be20377e5b1a6e71f572eb28ed049ed3fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Thu, 4 Jan 2024 17:46:48 +0100
Subject: [PATCH] tests: avoid NULL dereference in error branch
Reported by cppcheck.
---
tests/tst-pam_getenvlist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/tst-pam_getenvlist.c b/tests/tst-pam_getenvlist.c
index 62aea0615..d6abac915 100644
--- a/tests/tst-pam_getenvlist.c
+++ b/tests/tst-pam_getenvlist.c
@@ -78,7 +78,7 @@ main (void)
{
fprintf (stderr,
"pam_getenvlist (pamh) does not return pointer to NULL\n");
- temp = *ptr;
+ temp = ptr ? *ptr : NULL;
var = 0;
while (temp)
{