From: Niels Möller Date: Wed, 4 Jun 2014 18:09:02 +0000 (+0200) Subject: des-compat-test: Fix out of bounds memory read. X-Git-Tag: nettle_3.0_release_20140607~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abf3870cba401bc797676cdee84fea0091a2a581;p=thirdparty%2Fnettle.git des-compat-test: Fix out of bounds memory read. --- diff --git a/ChangeLog b/ChangeLog index 23e60d54..b083bda9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-06-04 Niels Möller + * testsuite/des-compat-test.c (test_main): Fixed out of bounds + memory read, reported by Nikos Mavrogiannopoulos. + * nettle-write.h: Include , fixing compilation on freebsd. diff --git a/testsuite/des-compat-test.c b/testsuite/des-compat-test.c index 6c648135..9e31f1c8 100644 --- a/testsuite/des-compat-test.c +++ b/testsuite/des-compat-test.c @@ -358,7 +358,7 @@ test_main(void) printf("Key error %2d:%d\n",i+2,j); err=1; } - if ((j=des_key_sched(&key_data[i+2],ks3)) != 0) + if (i+2 < NUM_TESTS && (j=des_key_sched(&key_data[i+2],ks3)) != 0) { printf("Key error %2d:%d\n",i+3,j); err=1;