mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 10:30:08 +01:00
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>
This commit is contained in:
parent
1afd0878e9
commit
477b310dfd
1 changed files with 2 additions and 1 deletions
|
|
@ -44,7 +44,8 @@ _mesa_sha1_init(struct mesa_sha1 *ctx)
|
|||
static inline void
|
||||
_mesa_sha1_update(struct mesa_sha1 *ctx, const void *data, size_t size)
|
||||
{
|
||||
SHA1Update(ctx, (const unsigned char *)data, size);
|
||||
if (size)
|
||||
SHA1Update(ctx, (const unsigned char *)data, size);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue