pipe-loader: avoid undefined memcpy behavior
authorYiwei Zhang <zzyiwei@chromium.org>
Fri, 12 May 2023 07:46:35 +0000 (00:46 -0700)
committerMarge Bot <emma+marge@anholt.net>
Fri, 12 May 2023 19:05:23 +0000 (19:05 +0000)
commit5b31039033114bb8e0de25b87119e8d97186bced
treee0d220325d312e232bf1d0da0ec99f9d31a7c285
parentd5cf6f7d2f9f399b08bac00f06be0470b8e0efb6
pipe-loader: avoid undefined memcpy behavior

If either dest or src is an invalid or null pointer, the behavior is
undefined, even if count is zero.

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22979>
src/gallium/auxiliary/pipe-loader/pipe_loader.c