From 1ee6767f40767e1ed221e8a0b06ddb15d332fa71 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 24 May 2000 23:42:01 +0000 Subject: [PATCH] explicitly cast to int four assignments of an unsigned long expression to and int variable. in three of the four cases this cast is questionable, as suitable range had not been checked, but the situation is no worse than without the casts. --- lib/dns/sec/openssl/md32_common.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/dns/sec/openssl/md32_common.h b/lib/dns/sec/openssl/md32_common.h index d1a556a7e1..300ba43f39 100644 --- a/lib/dns/sec/openssl/md32_common.h +++ b/lib/dns/sec/openssl/md32_common.h @@ -472,7 +472,8 @@ void HASH_UPDATE (HASH_CTX *c, const void *data_, unsigned long len) } } - sw=len/HASH_CBLOCK; + /* XXXDCL appropriate range has not been checked */ + sw=(int)(len/HASH_CBLOCK); if (sw > 0) { #if defined(HASH_BLOCK_DATA_ORDER_ALIGNED) @@ -512,9 +513,14 @@ void HASH_UPDATE (HASH_CTX *c, const void *data_, unsigned long len) if (len!=0) { p = c->data; - c->num = len; - ew=len>>2; /* words to copy */ - ec=len&0x03; + /* + * XXXDCL appropriate range has not been checked for + * the cast of each of the next two assignments. + */ + c->num = (int)len; + ew=(int)(len>>2); /* words to copy */ + /* This cast is ok. */ + ec=(int)(len&0x03); for (; ew; ew--,p++) { HOST_c2l(data,l); *p=l;