This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[COMMITTED] crypt: Fix badsalttest test (Bug 22765)
- From: Carlos O'Donell <carlos at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 1 Feb 2018 00:02:01 -0800
- Subject: [COMMITTED] crypt: Fix badsalttest test (Bug 22765)
- Authentication-results: sourceware.org; auth=none
Committed as obvious, small, correct, and not needing copyright
assignment.
2018-01-31 Il'ya Malakhov <ilmalakhov@yandex.ru>
[BZ #22765]
* crypt/badsalttest.c (do_test): Set cd.initialized to 0.
--
Cheers,
Carlos.
>From 9ff548a93612e558a6d0674820f36823931406f6 Mon Sep 17 00:00:00 2001
From: Il'ya Malakhov <ilmalakhov@yandex.ru>
Date: Wed, 31 Jan 2018 14:32:19 -0800
Subject: [PATCH] crypt: Fix badsalttest test (Bug 22765)
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.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
---
ChangeLog | 5 +++++
crypt/badsalttest.c | 3 +++
2 files changed, 8 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index b2cec4fea2..a5847a5a23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-31 Il'ya Malakhov <ilmalakhov@yandex.ru>
+
+ [BZ #22765]
+ * crypt/badsalttest.c (do_test): Set cd.initialized to 0.
+
2018-01-31 Dmitry V. Levin <ldv@altlinux.org>
* manual/install.texi (Tools for Compilation): Update the newest
diff --git a/crypt/badsalttest.c b/crypt/badsalttest.c
index 6c5230c399..3e57cdd3b8 100644
--- a/crypt/badsalttest.c
+++ b/crypt/badsalttest.c
@@ -61,6 +61,9 @@ do_test (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++)
{
if (crypt (tests[i][0], tests[i][1]))
--
2.14.3