about summary refs log tree commit homepage
path: root/ext/mwrap/mwrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mwrap/mwrap.c')
-rw-r--r--ext/mwrap/mwrap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/mwrap/mwrap.c b/ext/mwrap/mwrap.c
index 90f560e..08761d6 100644
--- a/ext/mwrap/mwrap.c
+++ b/ext/mwrap/mwrap.c
@@ -470,6 +470,8 @@ static struct src_loc *update_stats_rcu_lock(size_t size, uintptr_t caller)
 
                 /* avoid vsnprintf or anything which could call malloc here: */
                 len = strlen(ptr);
+                if (len > PATH_MAX)
+                        len = PATH_MAX;
                 k = (void *)kbuf;
                 k->total = size;
                 dst = mempcpy(k->k, ptr, len);