UBSAN: Undefined behaviour in ../sysdeps/posix/sprofil.c:272:16 variable length array bound evaluates to non-positive value 0
Move the VLA to after the porfile stop condition (where size might
be zero).
__sprofil (struct prof *profp, int profcnt, struct timeval *tvp,
unsigned int flags)
{
- struct prof *p[profcnt];
struct itimerval timer;
struct sigaction act;
int i;
return 0;
}
+ struct prof *p[profcnt];
prof_info.num_regions = 0;
prof_info.region = NULL;
prof_info.overflow = &default_overflow_region;