Skip to content

Commit

Permalink
Fixed missing check for max number of key parts (fixes #1120)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitko Iliev authored and pkleef committed Apr 13, 2023
1 parent db0b768 commit ea8b2c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libsrc/Wi/ddlrun.c
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,8 @@ ddl_create_key (query_instance_t * qi,
char *szTheTableName;
dk_set_t to_free = NULL;

if (n_parts > K_MAX_PARTS)
sqlr_new_error ("42S12", "SQ017", "Too many key parts");
memcpy (parts_tmp, parts, box_length ((caddr_t) parts));

qr_rec_exec (find_primary_stmt, cli, &lc_keys, qi, NULL, 1,
Expand Down

0 comments on commit ea8b2c9

Please sign in to comment.