File realpath-underflow.patch of Package glibc.8004

* stdlib/canonicalize.c (__realpath): Return error with ENOENT if
	resolving a relative file name and root is no longer accessible.

Index: glibc-2.19/stdlib/canonicalize.c
===================================================================
--- glibc-2.19.orig/stdlib/canonicalize.c
+++ glibc-2.19/stdlib/canonicalize.c
@@ -90,6 +90,14 @@ __realpath (const char *name, char *reso
 	  rpath[0] = '\0';
 	  goto error;
 	}
+      if (rpath[0] != '/')
+	{
+	  /* If getcwd returned a non-absolute file name the root
+	     directory is no longer accessible to the current process.  */
+	  __set_errno (ENOENT);
+	  rpath[0] = '\0';
+	  goto error;
+	}
       dest = __rawmemchr (rpath, '\0');
     }
   else
openSUSE Build Service is sponsored by