mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-22 16:10:36 +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>
This commit is contained in:
parent
59bb0ff945
commit
f13042ec7e
1 changed files with 3 additions and 0 deletions
|
|
@ -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