]> granicus.if.org Git - icu/commit
ICU-21143 Applying non-zero offset to null pointer is undefined behaviour.
authorFredrik Roubert <roubert@google.com>
Tue, 2 Jun 2020 20:35:20 +0000 (22:35 +0200)
committerFredrik Roubert <fredrik@roubert.name>
Thu, 4 Jun 2020 13:13:36 +0000 (15:13 +0200)
commit0735ea8c6f6a0efa258db1f047edc63a43c6aafa
tree6f921f76d0ece56d69a8e1e7d62e9826dce3d434
parent56bb01ba84f072ac38e9fdea4abdfb13bdd7c906
ICU-21143 Applying non-zero offset to null pointer is undefined behaviour.

The result of pointer end + 1 will not be used if end is nullptr so it
doesn't really matter that the result of this operation is undefined,
but it's therefore also unnecessary to perform the operation at all.

Changing this removes this unnecessary operation and by doing so gives
the undefined behaviour sanitizer one thing less to worry about.
icu4c/source/common/locid.cpp