[PATCH 5/7] sha2: fix invalid length check

Lucas Stach dev at lynxeye.de
Mon Oct 20 11:15:59 PDT 2014


length is unsigned an thus can never be <0.

Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 crypto/sha2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/sha2.c b/crypto/sha2.c
index 26162e8..e495313 100644
--- a/crypto/sha2.c
+++ b/crypto/sha2.c
@@ -208,7 +208,7 @@ static void sha2_update(sha2_context * ctx, const uint8_t * input, size_t length
 	size_t fill;
 	uint32_t left;
 
-	if (length <= 0)
+	if (length = 0)
 		return;
 
 	left = ctx->total[0] & 0x3F;
-- 
1.9.3




More information about the barebox mailing list