util: skip zero-sized SHA1Update
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 27 Sep 2023 14:55:25 +0000 (15:55 +0100)
committerMarge Bot <emma+marge@anholt.net>
Wed, 25 Oct 2023 17:27:47 +0000 (17:27 +0000)
commit477b310dfd5ec662837e2e1cde87b9416dbcf67f
treebca783754a61ee497c80957aa0761d99b1b49f8b
parent1afd0878e98aedeadd4f27186e5080bb33f55f67
util: skip zero-sized SHA1Update

Fixes UBSan error:
src/util/sha1/sha1.c:140:8: runtime error: null pointer passed as argument 2, which is declared to never be null

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25853>
src/util/mesa-sha1.h