Commit 583868f
committed
MDEV-35717: UBSAN: runtime error: applying zero offset to null pointer in
Problem:
UBSAN reports runtime errors in string comparision functions where
pointer arithmetic is done without checking NULL.
Fix:
Defines a new function `streq_safe` as a replacement for `streq` that
resulted in UBSAN errors, capable of handling NULL pointers. Also
makes `is_infoschema_db` and `is_perfschema_db` use `streq_safe` for
comparision.my_strnncoll_utf8mb3_general1400_as_ci
1 parent e47db94 commit 583868f
10 files changed
Lines changed: 62 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
131 | 160 | | |
132 | 161 | | |
133 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4704 | 4704 | | |
4705 | 4705 | | |
4706 | 4706 | | |
4707 | | - | |
| 4707 | + | |
4708 | 4708 | | |
4709 | 4709 | | |
4710 | 4710 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2586 | 2586 | | |
2587 | 2587 | | |
2588 | 2588 | | |
2589 | | - | |
| 2589 | + | |
2590 | 2590 | | |
2591 | 2591 | | |
2592 | 2592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6441 | 6441 | | |
6442 | 6442 | | |
6443 | 6443 | | |
6444 | | - | |
| 6444 | + | |
6445 | 6445 | | |
6446 | 6446 | | |
6447 | 6447 | | |
| |||
6752 | 6752 | | |
6753 | 6753 | | |
6754 | 6754 | | |
6755 | | - | |
| 6755 | + | |
6756 | 6756 | | |
6757 | 6757 | | |
6758 | 6758 | | |
| |||
9477 | 9477 | | |
9478 | 9478 | | |
9479 | 9479 | | |
9480 | | - | |
| 9480 | + | |
9481 | 9481 | | |
9482 | 9482 | | |
9483 | 9483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3618 | 3618 | | |
3619 | 3619 | | |
3620 | 3620 | | |
3621 | | - | |
| 3621 | + | |
3622 | 3622 | | |
3623 | 3623 | | |
3624 | 3624 | | |
3625 | 3625 | | |
3626 | | - | |
| 3626 | + | |
3627 | 3627 | | |
3628 | 3628 | | |
3629 | 3629 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
| |||
0 commit comments