aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorbobsayshilol <bobsayshilol@live.co.uk>2024-10-27 18:35:14 +0000
committerbobsayshilol <bobsayshilol@live.co.uk>2024-10-27 22:02:34 +0000
commite67692b0661ab23837079b2ed7340ff85ca88cd6 (patch)
tree3f7d84fd3b0ba464717299fb59dee79e665728e0 /src/string.cpp
parent771d308d643f9e3d59b2451fe18c5bdd845aba1e (diff)
Avoid member access through nullptr in debug
If |result_count| is 0 then |results| will be a nullptr and hence the access |results->Tuple| is undefined behaviour. There's already an early return in the 0 branch so move that to be the first thing so that we can guarantee that it's not a nullptr. Note that technically we take the address of the result so it's not actually dereferencing it, however UBSan doesn't care about that.
Diffstat (limited to 'src/string.cpp')
0 files changed, 0 insertions, 0 deletions