Skip to content

Commit

Permalink
MDEV-21341: Fix UBSAN failures, part #5
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
spetrunia committed Jan 15, 2020
1 parent 5e5ae51 commit 4635047
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sql/item_func.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit 4635047

Please sign in to comment.