summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-12-13 13:56:23 +0100
committerAtomic Bot <atomic-devel@projectatomic.io>2016-12-13 13:42:53 +0000
commit166e76e73658d6addd869c7f72ede9a03a01b5ee (patch)
treee6180f83f4f56a0698155c5223d0d42b5223985c
parente769cf9f434d90815bef7a19738bbe1963eee082 (diff)
downloadbubblewrap-166e76e73658d6addd869c7f72ede9a03a01b5ee.tar.gz
bind-mount: Check for errors in realpath()
Closes: #129 Approved by: cgwalters
-rw-r--r--bind-mount.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bind-mount.c b/bind-mount.c
index 3940b08..7d3543f 100644
--- a/bind-mount.c
+++ b/bind-mount.c
@@ -396,6 +396,8 @@ bind_mount (int proc_fd,
/* The mount operation will resolve any symlinks in the destination
path, so to find it in the mount table we need to do that too. */
resolved_dest = realpath (dest, NULL);
+ if (resolved_dest == NULL)
+ return 2;
mount_tab = parse_mountinfo (proc_fd, resolved_dest);
if (mount_tab[0].mountpoint == NULL)