public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wangxuszcn at foxmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug dynamic-link/28395] result.val is aligned malloc pointer, may not be check NULL in allocate_and_init()
Date: Thu, 30 Sep 2021 04:25:41 +0000 [thread overview]
Message-ID: <bug-28395-131-Bqg35g6Tmu@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28395-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=28395
--- Comment #2 from wangxu <wangxuszcn at foxmail dot com> ---
(In reply to Andreas Schwab from comment #1)
> When does this make a difference?
Original pointer of buffer allocated in allocate_dtv_entry() is assigned to
.to_free, while .val is aligned pointer of buffer.
/* Allocate one DTV entry. */
static struct dtv_pointer allocate_dtv_entry (size_t alignment, size_t size)
{
......
void *start = malloc (alloc_size);
/* Find the aligned position within the larger allocation. */
void *aligned = (void *) roundup ((uintptr_t) start, alignment);
return (struct dtv_pointer) { .val = aligned, .to_free = start };
}
--
You are receiving this mail because:
You are on the CC list for the bug.
next prev parent reply other threads:[~2021-09-30 4:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-29 4:00 [Bug dynamic-link/28395] New: " wangxuszcn at foxmail dot com
2021-09-29 7:38 ` [Bug dynamic-link/28395] " schwab@linux-m68k.org
2021-09-30 4:25 ` wangxuszcn at foxmail dot com [this message]
2021-09-30 17:14 ` fweimer at redhat dot com
2024-01-11 8:56 ` fweimer at redhat dot com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-28395-131-Bqg35g6Tmu@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=glibc-bugs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).