diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-02 14:19:21 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-11-02 14:19:21 +0200 |
commit | 8036d0a3590dddf4d51ba02bc74ba3a5a96674f7 (patch) | |
tree | 13fc7d26725fc5fd58a058b5d8563afef0835ae3 /client | |
parent | d2fab686670fcc6d23930298e4256734dfdbc413 (diff) | |
download | mariadb-git-8036d0a3590dddf4d51ba02bc74ba3a5a96674f7.tar.gz |
MDEV-22387: Do not violate __attribute__((nonnull))
This follows up commit
commit 94a520ddbe39ae97de1135d98699cf2674e6b77e and
commit 7c5519c12d46ead947d341cbdcbb6fbbe4d4fe1b.
After these changes, the default test suites on a
cmake -DWITH_UBSAN=ON build no longer fail due to passing
null pointers as parameters that are declared to never be null,
but plenty of other runtime errors remain.
Diffstat (limited to 'client')
-rw-r--r-- | client/completion_hash.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/client/completion_hash.cc b/client/completion_hash.cc index 553d0a1f926..30c0dc6260b 100644 --- a/client/completion_hash.cc +++ b/client/completion_hash.cc @@ -205,7 +205,8 @@ Bucket *find_longest_match(HashTable *ht, char *str, uint length, void completion_hash_clean(HashTable *ht) { free_root(&ht->mem_root,MYF(0)); - bzero((char*) ht->arBuckets,ht->nTableSize*sizeof(Bucket *)); + if (size_t s= ht->nTableSize) + bzero((char*) ht->arBuckets, s * sizeof(Bucket *)); } |