mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
stdlib: Improve tst-realpath compatibility with source fortification
On GCC before 11, IPA can make the fortified realpath aware that the buffer size is not large enough (8 bytes instead of PATH_MAX bytes). Fix this by using a buffer that is large enough.
This commit is contained in:
parent
78ca34d8c5
commit
510fc20d73
1 changed files with 6 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
||||||
License along with the GNU C Library; if not, see
|
License along with the GNU C Library; if not, see
|
||||||
<https://www.gnu.org/licenses/>. */
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
@ -50,7 +51,11 @@ void dealloc (void *p)
|
||||||
|
|
||||||
char* alloc (void)
|
char* alloc (void)
|
||||||
{
|
{
|
||||||
return (char *)malloc (8);
|
#ifdef PATH_MAX
|
||||||
|
return (char *)malloc (PATH_MAX);
|
||||||
|
#else
|
||||||
|
return (char *)malloc (4096);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Add table
Reference in a new issue