mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
reworked talloc() to in order to help track down invalid
memory access.
Tridge, I don't think using 0xdeadbeef for size allocations
of 0 is going to work. I ended up having to use NULL
as much code that works on UNISTR checks to see if the buffer ptr
is NULL. So valid code ends up with a seg fault.
Rather than rewriting it all, I added a DEBUG_TALLOC
#ifdef in talloc.h that sets a macro BAD_PTR.
This is the value assigned to ptr for an allocation of 0 bytes.
jerry
(This used to be commit 233b9cffa2
)
This commit is contained in:
@ -21,6 +21,12 @@
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifdef DEBUG_TALLOC
|
||||
#define BAD_PTR (void*)0xdeadbeef
|
||||
#else
|
||||
#define BAD_PTR NULL
|
||||
#endif
|
||||
|
||||
struct talloc_chunk {
|
||||
struct talloc_chunk *next;
|
||||
void *ptr;
|
||||
|
Reference in New Issue
Block a user