aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libsandbox/canonicalize.c')
-rw-r--r--libsandbox/canonicalize.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libsandbox/canonicalize.c b/libsandbox/canonicalize.c
index 2166ac9..2bef6b1 100644
--- a/libsandbox/canonicalize.c
+++ b/libsandbox/canonicalize.c
@@ -76,8 +76,14 @@ erealpath(const char *name, char *resolved)
if (resolved == NULL) {
rpath = xmalloc(path_max);
- } else
+ } else {
+ /* We can't handle resolving a buffer inline, so demand
+ * separate read and write strings.
+ */
+ if (name == resolved)
+ sb_abort();
rpath = resolved;
+ }
rpath_limit = rpath + path_max;
recover = NULL;