rusticl/api: Fix creating a program if a nul byte is within the specified string...
authorLingMan <18294-LingMan@users.noreply.gitlab.freedesktop.org>
Wed, 5 Oct 2022 20:00:56 +0000 (22:00 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 19 Oct 2022 23:32:50 +0000 (23:32 +0000)
commitd64b9ea4835eb6a38b5522b5470e7cd0e43a071a
tree04d17a24a59e0fa014c269283ea42ccbf868b9fd
parent9de42613bfdefecb1f4a3a10a99311f4e80b095c
rusticl/api: Fix creating a program if a nul byte is within the specified string length

The code assumed that if the length of a string was specified and greater than zero, the string
would not contain a nul byte.
Legal or not, there are apparently applications which violate that assumption. Since the spec
doesn't say anything about this case, take the likely most compatible route and treat a nul byte as
terminating the string early.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7408
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18978>
src/gallium/frontends/rusticl/api/program.rs