From: Julian Seward Date: Sun, 16 Jun 2002 11:37:06 +0000 (+0000) Subject: Fix bug in and simply parameter access checks for pthread_sigmask. X-Git-Tag: svn/VALGRIND_1_0_3~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31d365049aecf37f0db26165abd1ddafade46dba;p=thirdparty%2Fvalgrind.git Fix bug in and simply parameter access checks for pthread_sigmask. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@429 --- 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 "