From: Arjan van de Ven <arjanv@redhat.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: torvalds@transmeta.com
Subject: Re: Merge with DRI CVS tree: remove stale old context switching code and
Date: 26 Apr 2003 11:03:05 +0200 [thread overview]
Message-ID: <1051347784.1421.4.camel@laptop.fenrus.com> (raw)
In-Reply-To: <200304260008.h3Q08gYK005886@hera.kernel.org>
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]
On Sat, 2003-04-26 at 00:58, Linux Kernel Mailing List wrote:
>
> void *DRM(realloc)(void *oldpt, size_t oldsize, size_t size, int area)
> {
> void *pt;
>
> - if (!(pt = DRM(alloc)(size, area))) return NULL;
> + if (!(pt = kmalloc(size, GFP_KERNEL))) return NULL;
> if (oldpt && oldsize) {
> memcpy(pt, oldpt, oldsize);
> - DRM(free)(oldpt, oldsize, area);
> + kfree(oldpt);
> }
> return pt;
> }
this looks like buggy code, if you use realloc to shrink the allocation
the memcpy overwrites random memory.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
parent reply other threads:[~2003-04-26 8:50 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200304260008.h3Q08gYK005886@hera.kernel.org>]
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=1051347784.1421.4.camel@laptop.fenrus.com \
--to=arjanv@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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 NNTP newsgroup(s).