]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
des-compat-test: Fix out of bounds memory read.
authorNiels Möller <nisse@lysator.liu.se>
Wed, 4 Jun 2014 18:09:02 +0000 (20:09 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Wed, 4 Jun 2014 18:09:02 +0000 (20:09 +0200)
ChangeLog
testsuite/des-compat-test.c

index 23e60d54a25aacbb084689a354250d82bb880d8c..b083bda9ce8719fc0fc5e481d7c1f65b4ec8061f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-06-04  Niels Möller  <nisse@lysator.liu.se>
 
+       * testsuite/des-compat-test.c (test_main): Fixed out of bounds
+       memory read, reported by Nikos Mavrogiannopoulos.
+
        * nettle-write.h: Include <stddef.h>, fixing compilation on
        freebsd.
 
index 6c64813560c968a920b16981622e0476c138ef83..9e31f1c8ef9b24b1b85f3979b24f6b12aff98ebe 100644 (file)
@@ -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;