glibc/tests/Regression/bz455360-RHEL4-vfprintf-call-goes-into-recursive/testcase.c
Martin Coufal d1b1cc9c26 CI Tests: fix Regression/bz455360-RHEL4-vfprintf-call-goes-into-recursive
* add 'gcc' to required packages
* include 'unistd.h'
2024-02-02 14:30:22 +00:00

18 lines
340 B
C

#include <stdio.h>
#include <string.h>
#include <unistd.h>
int
main (void)
{
char str[8192+2048];
memset (str, 'A', sizeof (str) - 1);
str[sizeof (str) - 1] = '\0';
FILE *f = fopen ("abcd", "w");
setvbuf (f, NULL, _IONBF, 0);
/* Force error on next overflow. */
close (fileno (f));
fprintf (f, "%s\n", str);
return 0;
}