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 /sql/unireg.h | |
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 'sql/unireg.h')
-rw-r--r-- | sql/unireg.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/unireg.h b/sql/unireg.h index 6ce638928e8..efc3d6958f5 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -78,7 +78,8 @@ #define cmp_record(A,B) memcmp((A)->record[0],(A)->B,(size_t) (A)->s->reclength) #define empty_record(A) { \ restore_record((A),s->default_values); \ - bfill((A)->null_flags,(A)->s->null_bytes,255);\ + if ((A)->s->null_bytes) \ + bfill((A)->null_flags,(A)->s->null_bytes,255); \ } /* Defines for use with openfrm, openprt and openfrd */ |