--=_courier-11174-1051347970-0001-2
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
On Sat, 2003-04-26 at 00:58, Linux Kernel Mailing List wrote:
> =20
> void *DRM(realloc)(void *oldpt, size_t oldsize, size_t size, int area)
> {
> void *pt;
> =20
> - if (!(pt =3D DRM(alloc)(size, area))) return NULL;
> + if (!(pt =3D 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.
--=_courier-11174-1051347970-0001-2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Transfer-Encoding: 7bit
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQA+qktIxULwo51rQBIRAkWxAJ96+Ppq8oKY5DhXXpOMsU9PIplIRgCfW+F3
tKPxeaesgt/Q57yLl7OSdi0=
=OMb0
-----END PGP SIGNATURE-----
--=_courier-11174-1051347970-0001-2--