From: Julian Seward Date: Fri, 30 Sep 2005 01:47:12 +0000 (+0000) Subject: Placate memcheck/tests/x86/scalar, which objected to the rewrite of X-Git-Tag: svn/VALGRIND_3_1_0~397 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69a3fadbde74d7fac89fa131ede122d7b072fd0f;p=thirdparty%2Fvalgrind.git Placate memcheck/tests/x86/scalar, which objected to the rewrite of the sys_readlink wrapper. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4831 --- diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index ca36d6561c..4b56818065 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -4639,8 +4639,9 @@ PRE(sys_readlink) * /proc//exe. */ VG_(sprintf)(name, "/proc/%d/exe", VG_(getpid)()); - if (VG_(strcmp)((Char *)ARG1, name) == 0 - || VG_(strcmp)((Char *)ARG1, "/proc/self/exe") == 0) { + if (ML_(safe_to_deref)(ARG1, 1) + && (VG_(strcmp)((Char *)ARG1, name) == 0 + || VG_(strcmp)((Char *)ARG1, "/proc/self/exe") == 0)) { VG_(sprintf)(name, "/proc/self/fd/%d", VG_(cl_exec_fd)); SET_STATUS_from_SysRes( VG_(do_syscall3)(saved, (UWord)name, ARG2, ARG3));