]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Placate memcheck/tests/x86/scalar, which objected to the rewrite of
authorJulian Seward <jseward@acm.org>
Fri, 30 Sep 2005 01:47:12 +0000 (01:47 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 30 Sep 2005 01:47:12 +0000 (01:47 +0000)
the sys_readlink wrapper.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4831

coregrind/m_syswrap/syswrap-generic.c

index ca36d6561cd6f53bbd2421ec8132ad770ee55d61..4b56818065c59f75b9b96f138193c99e05d9c3aa 100644 (file)
@@ -4639,8 +4639,9 @@ PRE(sys_readlink)
     * /proc/<pid>/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));