Question about malloc_useable_size

Wolfram Gloger wmglo@dent.med.uni-muenchen.de
Mon Jun 13 09:01:00 GMT 2005


Hi,

> netgrp->data was created with malloc (len + 1); But there is a
> report (see Bug #962), that the assert sometimes fails with
> malloc_usable_size (netgrp->data) reporting 992, while len is 1002.
> How can this happen?

I cannot see a bug in the netgrp->data allocation, either.  However,
this does point toward a bug, perhaps the previous chunk is overrun
somewhere in the application and malloc's internal size field is
changed from 1008 to 992.  On little-endian arch, this could be caused
by a single byte overrun.

Regards,
Wolfram.



More information about the Libc-alpha mailing list