MDEV-21341: Fix UBSAN failures, part #5

Item_cond inherits from Item_args but doesn't store its arguments
as function arguments, which means it has zero arguments.
Don't call memcpy in this case.
This commit is contained in:
Sergei Petrunia 2020-01-15 16:34:51 +03:00
parent 5e5ae51b73
commit 4635047ca1

View file

@ -109,7 +109,8 @@ Item_args::Item_args(THD *thd, const Item_args *other)
arg_count= 0;
return;
}
memcpy(args, other->args, sizeof(Item*) * arg_count);
if (arg_count)
memcpy(args, other->args, sizeof(Item*) * arg_count);
}