29 lines
968 B
Diff
29 lines
968 B
Diff
From b84539c87d1522b73359772c0d6521a0f0fd5b68 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org>
|
|
Date: Thu, 1 Feb 2018 14:15:04 +0100
|
|
Subject: [PATCH] test-crypt-badsalt: Initialize cd before calling crypt_r
|
|
|
|
The value of 'cd.initialized' is left uninitialized before the
|
|
first invocation of 'crypt_r ()' in this test despite the fact
|
|
that it should be set to zero according to the API.
|
|
|
|
Ported from glibc commit: 650ba77ad547b24e0839c90ed56f7b9445d8165a
|
|
---
|
|
test-crypt-badsalt.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/test-crypt-badsalt.c b/test-crypt-badsalt.c
|
|
index 12892ba..1e1e840 100644
|
|
--- a/test-crypt-badsalt.c
|
|
+++ b/test-crypt-badsalt.c
|
|
@@ -68,6 +68,9 @@ main (void)
|
|
tests[n - 1][1] = &page[pagesize - 1];
|
|
}
|
|
|
|
+ /* Mark cd as initialized before first call to crypt_r. */
|
|
+ cd.initialized = 0;
|
|
+
|
|
for (size_t i = 0; i < n; i++)
|
|
{
|
|
retval = crypt (tests[i][0], tests[i][1]);
|