Skip to content

Commit 4f7ee93

Browse files
committed
Revert "Prevent integer overflow"
This reverts commit 4ec1dad.
1 parent 4ec1dad commit 4f7ee93

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

umac.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,11 +1055,8 @@ static int uhash_update(uhash_ctx_t ctx, const u_char *input, long len)
10551055
UINT64 result_buf[STREAMS];
10561056
UINT8 *nh_result = (UINT8 *)&result_buf;
10571057

1058-
if (len < 0 || (unsigned long)len > UINT32_MAX)
1059-
return (0);
1060-
10611058
if (ctx->msg_len + len <= L1_KEY_LEN) {
1062-
nh_update(&ctx->hash, (const UINT8 *)input, (UINT32)len);
1059+
nh_update(&ctx->hash, (const UINT8 *)input, len);
10631060
ctx->msg_len += len;
10641061
} else {
10651062

@@ -1096,7 +1093,6 @@ static int uhash_update(uhash_ctx_t ctx, const u_char *input, long len)
10961093
/* pass remaining < L1_KEY_LEN bytes of input data to NH */
10971094
if (len > 0 && (unsigned long)len <= UINT32_MAX) {
10981095
nh_update(&ctx->hash, (const UINT8 *)input, len);
1099-
nh_update(&ctx->hash, (const UINT8 *)input, (UINT32)len);
11001096
ctx->msg_len += len;
11011097
}
11021098
}

0 commit comments

Comments
 (0)