From: Il'ya Malakhov Date: Wed, 31 Jan 2018 22:32:19 +0000 (-0800) Subject: crypt: Fix badsalttest test (Bug 22765) X-Git-Tag: glibc-2.27~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=650ba77ad547b24e0839c90ed56f7b9445d8165a;p=thirdparty%2Fglibc.git 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 --- diff --git a/ChangeLog b/ChangeLog index b2cec4fea2b..a5847a5a23d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-01-31 Il'ya Malakhov + + [BZ #22765] + * crypt/badsalttest.c (do_test): Set cd.initialized to 0. + 2018-01-31 Dmitry V. Levin * manual/install.texi (Tools for Compilation): Update the newest diff --git a/crypt/badsalttest.c b/crypt/badsalttest.c index 6c5230c399e..3e57cdd3b8b 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]))