From 31d365049aecf37f0db26165abd1ddafade46dba Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Sun, 16 Jun 2002 11:37:06 +0000 Subject: [PATCH] Fix bug in and simply parameter access checks for pthread_sigmask. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@429 --- coregrind/vg_scheduler.c | 8 +++----- vg_scheduler.c | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/coregrind/vg_scheduler.c b/coregrind/vg_scheduler.c index c675a83983..7bc9de586b 100644 --- a/coregrind/vg_scheduler.c +++ b/coregrind/vg_scheduler.c @@ -2920,16 +2920,14 @@ void do_pthread_sigmask ( ThreadId tid, if (VG_(clo_instrument)) { /* check newmask/oldmask are addressible/defined */ - if (VG_(clo_instrument) - && newmask + if (newmask && !VGM_(check_readable)( (Addr)newmask, sizeof(vki_ksigset_t), NULL)) VG_(record_pthread_err)( tid, "pthread_sigmask: newmask contains " "unaddressible or undefined bytes"); - if (VG_(clo_instrument) - && oldmask - && !VGM_(check_readable)( (Addr)oldmask, + if (oldmask + && !VGM_(check_writable)( (Addr)oldmask, sizeof(vki_ksigset_t), NULL)) VG_(record_pthread_err)( tid, "pthread_sigmask: oldmask contains " diff --git a/vg_scheduler.c b/vg_scheduler.c index c675a83983..7bc9de586b 100644 --- a/vg_scheduler.c +++ b/vg_scheduler.c @@ -2920,16 +2920,14 @@ void do_pthread_sigmask ( ThreadId tid, if (VG_(clo_instrument)) { /* check newmask/oldmask are addressible/defined */ - if (VG_(clo_instrument) - && newmask + if (newmask && !VGM_(check_readable)( (Addr)newmask, sizeof(vki_ksigset_t), NULL)) VG_(record_pthread_err)( tid, "pthread_sigmask: newmask contains " "unaddressible or undefined bytes"); - if (VG_(clo_instrument) - && oldmask - && !VGM_(check_readable)( (Addr)oldmask, + if (oldmask + && !VGM_(check_writable)( (Addr)oldmask, sizeof(vki_ksigset_t), NULL)) VG_(record_pthread_err)( tid, "pthread_sigmask: oldmask contains " -- 2.47.2