Skip to content
Snippets Groups Projects
Commit 6883ae43 authored by Tomasz Śniatowski's avatar Tomasz Śniatowski Committed by Adam Jackson
Browse files

os: Fix strtok/free crash in ComputeLocalClient

Don't reuse cmd for strtok output to ensure the proper pointer is
freed afterwards.

The code incorrectly assumed the pointer returned by strtok(cmd, ":")
would always point to cmd. However, strtok(str, sep) != str if str
begins with sep. This caused an invalid-free crash when running
a program under X with a name beginning with a colon.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=104123


Signed-off-by: default avatarTomasz Śniatowski <kailoran@gmail.com>
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
parent aa6651f8
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment