Messages in this thread | | | Subject | Re: Merge with DRI CVS tree: remove stale old context switching code and | From | Arjan van de Ven <> | Date | 26 Apr 2003 11:03:05 +0200 |
| |
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.
[unhandled content-type:application/pgp-signature] | |