From 7185fedaaa7ab13b28c71a65462ede2488e02194 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 25 Apr 2021 23:38:52 +0800 Subject: [PATCH] Simplify the validation of strlen_b branch in check_used_slot The final result should be same as before Signed-off-by: Xiang Xiao Change-Id: Ie474524978c4d62d0cddf1c204da972c49021097 --- chunk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chunk.c b/chunk.c index 9f3d52f8..033fd5fb 100644 --- a/chunk.c +++ b/chunk.c @@ -1658,8 +1658,7 @@ static int check_used_slot(const skip_alloc_t *slot_p, } } /* mem_p can == bounds_p (if equals-ok) if we hit the min_size but can't >= user_bounds */ - if (mem_p > (char *)pnt_info.pi_user_bounds - || ((! equals_okay_b) && mem_p == (char *)pnt_info.pi_user_bounds)) { + if ((! equals_okay_b) && mem_p == bounds_p) { dmalloc_errno = DMALLOC_ERROR_WOULD_OVERWRITE; return 0; }