Skip to contentSkip to conversation

pcm: dshare - fix shared memory pointer check

DISCUSSION GitHub pull_request - opened 1 participant 1 message Mar 21, 2021 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

alsa-project/alsa-lib pull request #128 was opened from VanithaChannaiah:

Currently shared memory pointer is initialized to 0 and set to -1 in some, but not in all error paths.
In cleanup path of open the shm pointer is only compared to be non-NULL before dereferencing it which leads to SEGFAULT in case it was set to -1.

This patch initializes pointer to -1 to have a unique identification for invalid pointer and also checks for pointer being not -1 on access in cleanup path.

Request URL : https://github.com/alsa-project/alsa-lib/pull/128
Patch URL : https://github.com/alsa-project/alsa-lib/pull/128.patch
Repository URL: https://github.com/alsa-project/alsa-lib