Skip to content
Commit dbf97534 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>
(cherry picked from commit 6883ae43)
parent 072dff82
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment