[Cryptech-Commits] [sw/libhal] 02/04: Fix swapped memmove() arguments in hal_ks_index_replace().

git at cryptech.is git at cryptech.is
Wed Sep 28 20:33:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch ksng
in repository sw/libhal.

commit a9c0ad1888b7c7a94d46ded4a39dfb6cb3bbcb90
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Tue Sep 27 14:51:43 2016 -0400

    Fix swapped memmove() arguments in hal_ks_index_replace().
---
 ks_index.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ks_index.c b/ks_index.c
index 476faf9..5aae516 100644
--- a/ks_index.c
+++ b/ks_index.c
@@ -238,7 +238,7 @@ hal_error_t hal_ks_index_replace(hal_ks_index_t *ksi,
 
   const size_t len = (ksi->size - ksi->used - 1) * sizeof(*ksi->index);
   const uint16_t b = ksi->index[ksi->used];
-  memmove(&ksi->index[ksi->used + 1], &ksi->index[ksi->used], len);
+  memmove(&ksi->index[ksi->used], &ksi->index[ksi->used + 1], len);
   ksi->index[ksi->size - 1] = ksi->index[where];
   ksi->index[where] = b;
 



More information about the Commits mailing list