mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 07:18:17 +02:00
util: fix possible buffer overflow in util_get_process_exec_path
Found by Coverity. Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Fixes:f8f1413070("util/u_process: add util_get_process_exec_path") Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6067> (cherry picked from commitf13042ec7e)
This commit is contained in:
parent
75e81ff0d7
commit
f2de23e785
2 changed files with 4 additions and 1 deletions
|
|
@ -1804,7 +1804,7 @@
|
|||
"description": "util: fix possible buffer overflow in util_get_process_exec_path",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "f8f1413070ae079443ab31a75679cfd10cb756ed"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -187,6 +187,9 @@ util_get_process_exec_path(char* process_path, size_t len)
|
|||
|
||||
return 0;
|
||||
success:
|
||||
if (r == len)
|
||||
return 0;
|
||||
|
||||
process_path[r] = '\0';
|
||||
return r;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue