archive mirror
 help / color / mirror / Atom feed
From: Arjan van de Ven <>
To: Linux Kernel Mailing List <>
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: <> (raw)
In-Reply-To: <>

[-- 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 --]

           reply	other threads:[~2003-04-26  8:50 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <>]

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* 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).