diff options
author | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2022-06-27 07:39:19 -0600 |
---|---|---|
committer | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2022-06-27 07:39:35 -0600 |
commit | 02cc8a5140b673f475e1d19b6a610b0a8357e806 (patch) | |
tree | 00812cd350a8287409af14dc2f4ec8020971ce9a | |
parent | 57312cc9fd6f77d71d79b9c7614a057522689a6e (diff) | |
download | mariadb-git-10.2-MDEV-27355-rpl-ubsan.tar.gz |
MDEV-27655 Fix UBSAN's Findings in Replication10.2-MDEV-27355-rpl-ubsan
Tagged mysys/my_compare.c::ha_key_cmp() with attribute to ignore
UBSAN runtime checks on shift operations. In particular, it is
expected that this function can perform shift of greater length
than the number of bits in the underlying field variables.
-rw-r--r-- | mysys/my_compare.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mysys/my_compare.c b/mysys/my_compare.c index ff704aa40f0..bc7da123424 100644 --- a/mysys/my_compare.c +++ b/mysys/my_compare.c @@ -117,6 +117,11 @@ static int compare_bin(const uchar *a, uint a_length, #define FCMP(A,B) ((int) (A) - (int) (B)) +/* + Suppress run-time checks in this function for overflow because it + intentionally performs integer overflow in error checking. +*/ +__attribute__((no_sanitize("shift"))) int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a, const uchar *b, uint key_length, uint32 nextflag, uint *diff_pos) |