[Skiboot] [PATCH 6/6] libflash/test: Attempted fix of Coverity defect 98799

Cyril Bur cyril.bur at au1.ibm.com
Tue Sep 8 16:14:03 AEST 2015


Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>
---
 libflash/test/test-ecc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libflash/test/test-ecc.c b/libflash/test/test-ecc.c
index ad017b2..fb6ee64 100644
--- a/libflash/test/test-ecc.c
+++ b/libflash/test/test-ecc.c
@@ -388,7 +388,7 @@ int main(void)
 	/* Test that the ecc code can detect and recover bitflips */
 	printf("Testing bitflip recovery\n");
 	for (i = 0; i < 64; i++) {
-		ret_memcpy = memcpy_from_ecc(&dst, &ecc_data[i], 8);
+		ret_memcpy = memcpy_from_ecc(&dst, &ecc_data[i], sizeof(dst));
 		if (dst != 0xffffffffffffffff || ret_memcpy) {
 			ERR("ECC code didn't correct bad bit %d in 0x%016lx\n", 63 - i, be64toh(ecc_data[i].data));
 			exit(1);
-- 
2.5.1



More information about the Skiboot mailing list