Skip to content

Fix potential NULL pointer dereference #9872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions TSRM/tsrm_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
{/*{{{*/
shm_pair *shm = shm_get(key, NULL);

if (!shm->segment) {
if (!shm || !shm->segment) {
return (void*)-1;
}

Expand All @@ -726,7 +726,7 @@ TSRM_API int shmdt(const void *shmaddr)
shm_pair *shm = shm_get(0, (void*)shmaddr);
int ret;

if (!shm->segment) {
if (!shm || !shm->segment) {
return -1;
}

Expand All @@ -746,7 +746,7 @@ TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
{/*{{{*/
shm_pair *shm = shm_get(key, NULL);

if (!shm->segment) {
if (!shm || !shm->segment) {
return -1;
}

Expand Down