[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Fix a bug where we"d sometimes run off the end of an array ...
- To: or-cvs@freehaven.net
- Subject: [or-cvs] Fix a bug where we"d sometimes run off the end of an array ...
- From: nickm@seul.org (Nick Mathewson)
- Date: Fri, 20 Jun 2003 04:17:28 -0400 (EDT)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Fri, 20 Jun 2003 04:17:38 -0400
- Reply-to: or-dev@freehaven.net
- Sender: owner-or-cvs@freehaven.net
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv16190/src/or
Modified Files:
test.c
Log Message:
Fix a bug where we'd sometimes run off the end of an array while
testing stream encryption.
Index: test.c
===================================================================
RCS file: /home/or/cvsroot/src/or/test.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- test.c 17 Jun 2003 20:19:54 -0000 1.25
+++ test.c 20 Jun 2003 08:17:25 -0000 1.26
@@ -269,13 +269,13 @@
}
test_memeq(data1, data3, 560);
/* Now encrypt 3 at a time, and get 5 at a time. */
- for (j = 560; j < 1024; j += 3) {
+ for (j = 560; j < 1024-5; j += 3) {
crypto_cipher_encrypt(env1, data1+j, 3, data2+j);
}
- for (j = 560; j < 1024; j += 5) {
+ for (j = 560; j < 1024-5; j += 5) {
crypto_cipher_decrypt(env2, data2+j, 5, data3+j);
}
- test_memeq(data1, data3, 1024-4);
+ test_memeq(data1, data3, 1024-5);
/* Now make sure that when we encrypt with different chunk sizes, we get
the same results. */
crypto_free_cipher_env(env2);