Fix UBSan errors

This commit is contained in:
correctmost
2024-01-24 14:03:22 +00:00
committed by Gaël Bonithon
parent 7ba61f749b
commit 9bf1713e82
3 changed files with 10 additions and 4 deletions

View File

@@ -172,6 +172,9 @@ apps_lookup_pid (GArray *apps, GPid pid)
{
App tapp;
if (apps->data == NULL)
return (NULL);
tapp.pid = pid;
return (bsearch(&tapp, apps->data, apps->len, sizeof(App), app_pid_compare_fn));