From 115eecf6930562865b7847a8d7d746383b9a8f8f Mon Sep 17 00:00:00 2001 From: miod Date: Wed, 20 May 2015 04:33:35 +0000 Subject: [PATCH] No need to check the return value of memcpy() if you actually checked this pointer for NULL the line above; ok doug@ --- lib/libcrypto/ec/ec_lib.c | 5 ++--- lib/libssl/src/crypto/ec/ec_lib.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/libcrypto/ec/ec_lib.c b/lib/libcrypto/ec/ec_lib.c index d36c2c2e6e2..a12a2ffbb6f 100644 --- a/lib/libcrypto/ec/ec_lib.c +++ b/lib/libcrypto/ec/ec_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lib.c,v 1.17 2015/04/29 00:11:12 doug Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.18 2015/05/20 04:33:35 miod Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -216,8 +216,7 @@ EC_GROUP_copy(EC_GROUP * dest, const EC_GROUP * src) dest->seed = malloc(src->seed_len); if (dest->seed == NULL) return 0; - if (!memcpy(dest->seed, src->seed, src->seed_len)) - return 0; + memcpy(dest->seed, src->seed, src->seed_len); dest->seed_len = src->seed_len; } else { free(dest->seed); diff --git a/lib/libssl/src/crypto/ec/ec_lib.c b/lib/libssl/src/crypto/ec/ec_lib.c index d36c2c2e6e2..a12a2ffbb6f 100644 --- a/lib/libssl/src/crypto/ec/ec_lib.c +++ b/lib/libssl/src/crypto/ec/ec_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lib.c,v 1.17 2015/04/29 00:11:12 doug Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.18 2015/05/20 04:33:35 miod Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -216,8 +216,7 @@ EC_GROUP_copy(EC_GROUP * dest, const EC_GROUP * src) dest->seed = malloc(src->seed_len); if (dest->seed == NULL) return 0; - if (!memcpy(dest->seed, src->seed, src->seed_len)) - return 0; + memcpy(dest->seed, src->seed, src->seed_len); dest->seed_len = src->seed_len; } else { free(dest->seed); -- 2.20.1