Bug 21753 - malloc: Document assert redefinition and allign with <assert.h>
Summary: malloc: Document assert redefinition and allign with <assert.h>
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: malloc (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-11 23:58 UTC by Florian Weimer
Modified: 2017-07-12 08:20 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Weimer 2017-07-11 23:58:39 UTC
malloc needs to redefine assert because glibc's assert implementation itself calls asprintf (see bug 10217) which in turn calls malloc.  This should be explained in a comment.  See bug 10560.

The definition of that assert macro should use the same statement expression with an if statement as <assert.h>, to catch coding errors within malloc.