diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-01-21 12:50:49 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-01-22 11:39:54 +0100 |
commit | 36eb0b7a558542689ad654a770c3f1ce8f18dd87 (patch) | |
tree | dc89f7dff191c7dc5d103e71cfd94cdf0db7db9a /storage | |
parent | fa331acefd6b5907b06d394ae0ae096749129601 (diff) | |
download | mariadb-git-36eb0b7a558542689ad654a770c3f1ce8f18dd87.tar.gz |
improve ASAN instrumentation: table->record[0]
instrument table->record[0], table->record[1] and share->default_values.
One should not access record image beyond share->reclength, even
if table->record[0] has some unused space after it (functions that
work with records, might get a copy of the record as an argument,
and that copy - not being record[0] - might not have this buffer space
at the end). See b80fa4000d6 and 444587d8a3c
Diffstat (limited to 'storage')
-rw-r--r-- | storage/heap/ha_heap.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index 345ebb8419f..259e54bfc59 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -100,7 +100,15 @@ const char **ha_heap::bas_ext() const int ha_heap::open(const char *name, int mode, uint test_if_locked) { - set_if_bigger(table->s->reclength, sizeof (uchar*)); + if (table->s->reclength < sizeof (char*)) + { + MEM_UNDEFINED(table->s->default_values + table->s->reclength, + sizeof(char*) - table->s->reclength); + table->s->reclength= sizeof(char*); + MEM_UNDEFINED(table->record[0], table->s->reclength); + MEM_UNDEFINED(table->record[1], table->s->reclength); + } + internal_table= test(test_if_locked & HA_OPEN_INTERNAL_TABLE); if (internal_table || (!(file= heap_open(name, mode)) && my_errno == ENOENT)) { |