From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2130) id 941723858D33; Wed, 22 Feb 2023 22:05:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 941723858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677103505; bh=R+N5Gol8Mo/MjMlxUwCo5KiSPprudi3qjHGqdslhteQ=; h=From:To:Subject:Date:From; b=S3Y8R3EzXhhyH8/OVRMiSsy6lJ4VJLvCxGGGGrHrgBmIp86EkWaUFMhIyAij2x9gB sGVWcWzzNBUBaLYqDVWO1BSiDVFDQ4EjNtW8jePB9NPPzAssVdzs2Cg87guARjb/s6 0DYVDhTmU4Igf+StiV0qAPTL8fgPw5UUWV9L3txw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: DJ Delorie To: glibc-cvs@sourceware.org Subject: [glibc] malloc: remove redundant check of unsorted bin corruption X-Act-Checkin: glibc X-Git-Author: Ayush Mittal X-Git-Refname: refs/heads/master X-Git-Oldrev: eb63ccc0ce6a3a7f2c397d305233c876e8dc1632 X-Git-Newrev: 3f84f1159e9f3e9716eae46ba88616bb153fdd8c Message-Id: <20230222220505.941723858D33@sourceware.org> Date: Wed, 22 Feb 2023 22:05:05 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3f84f1159e9f3e9716eae46ba88616bb153fdd8c commit 3f84f1159e9f3e9716eae46ba88616bb153fdd8c Author: Ayush Mittal Date: Thu Apr 8 14:59:09 2021 +0530 malloc: remove redundant check of unsorted bin corruption * malloc/malloc.c (_int_malloc): remove redundant check of unsorted bin corruption With commit "b90ddd08f6dd688e651df9ee89ca3a69ff88cd0c" (malloc: Additional checks for unsorted bin integrity), same check of (bck->fd != victim) is added before checking of unsorted chunk corruption, which was added in "bdc3009b8ff0effdbbfb05eb6b10966753cbf9b8" (Added check before removing from unsorted list). .. 3773 if (__glibc_unlikely (bck->fd != victim) 3774 || __glibc_unlikely (victim->fd != unsorted_chunks (av))) 3775 malloc_printerr ("malloc(): unsorted double linked list corrupted"); .. .. 3815 /* remove from unsorted list */ 3816 if (__glibc_unlikely (bck->fd != victim)) 3817 malloc_printerr ("malloc(): corrupted unsorted chunks 3"); 3818 unsorted_chunks (av)->bk = bck; .. So this extra check can be removed. Signed-off-by: Maninder Singh Signed-off-by: Ayush Mittal Reviewed-by: DJ Delorie Diff: --- malloc/malloc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/malloc/malloc.c b/malloc/malloc.c index fd8b52bfac..5829f3fa9b 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -4034,8 +4034,6 @@ _int_malloc (mstate av, size_t bytes) } /* remove from unsorted list */ - if (__glibc_unlikely (bck->fd != victim)) - malloc_printerr ("malloc(): corrupted unsorted chunks 3"); unsorted_chunks (av)->bk = bck; bck->fd = unsorted_chunks (av);