mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 17:58:26 +02:00
rusticl/api: protect against 0 length in slice::from_raw_parts
Fixes:84d16045d0("rusticl/api: add param to query which contains application provided values") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30410> (cherry picked from commit81f75e2a2d)
This commit is contained in:
parent
fb663417c7
commit
68feb29646
2 changed files with 2 additions and 2 deletions
|
|
@ -134,7 +134,7 @@
|
|||
"description": "rusticl/api: protect against 0 length in slice::from_raw_parts",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "84d16045d034cf34e782febea7cf7d933b730ba6",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ pub trait CLInfo<I> {
|
|||
param_value: *mut ::std::os::raw::c_void,
|
||||
param_value_size_ret: *mut usize,
|
||||
) -> CLResult<()> {
|
||||
let arr = if !param_value.is_null() {
|
||||
let arr = if !param_value.is_null() && param_value_size != 0 {
|
||||
unsafe { slice::from_raw_parts(param_value.cast(), param_value_size) }
|
||||
} else {
|
||||
&[]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue