linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Merge with DRI CVS tree: remove stale old context switching code and
       [not found] <200304260008.h3Q08gYK005886@hera.kernel.org>
@ 2003-04-26  9:03 ` Arjan van de Ven
  0 siblings, 0 replies; only message in thread
From: Arjan van de Ven @ 2003-04-26  9:03 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: torvalds

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-26  8:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200304260008.h3Q08gYK005886@hera.kernel.org>
2003-04-26  9:03 ` Merge with DRI CVS tree: remove stale old context switching code and Arjan van de Ven

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