With CXXFLAGS='-fsanitize=undefined' GCC complains about passing NULL
pointer to function which parameter is marked as 'attribute__((nonnull))'.
{
fatal("Out of memory");
}
- memcpy (buf, bot, copy);
+ if (copy > 0) {
+ memcpy (buf, bot, copy);
+ }
tok = &buf[tok - bot];
mar = &buf[mar - bot];
ptr = &buf[ptr - bot];
{
const size_t n = static_cast<size_t>(se - sb);
succb = new cfg_ix_t[n];
- memcpy(succb, sb, n * sizeof(cfg_ix_t));
+ if (n > 0) memcpy(succb, sb, n * sizeof(cfg_ix_t));
succe = succb + n;
}