This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 8ae0dd9879d fs/mqueue: Derive MAX_MQUEUE_PATH from the VFS path and
NAME_MAX.
8ae0dd9879d is described below
commit 8ae0dd9879d6679291c2c64499968b3056e3a428
Author: tengshuangshuang <[email protected]>
AuthorDate: Thu Nov 12 19:25:48 2026 +0800
fs/mqueue: Derive MAX_MQUEUE_PATH from the VFS path and NAME_MAX.
A call to mq_open() with a name longer than {NAME_MAX} has to fail with
ENAMETOOLONG. Size the full path buffer from the configured
CONFIG_FS_MQUEUE_VFS_PATH and CONFIG_NAME_MAX instead of the fixed 64
bytes, so that the check and the buffer follow both settings.
Signed-off-by: tengshuangshuang <[email protected]>
---
fs/mqueue/mqueue.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/mqueue/mqueue.h b/fs/mqueue/mqueue.h
index a3ed24a95fc..21aaa461461 100644
--- a/fs/mqueue/mqueue.h
+++ b/fs/mqueue/mqueue.h
@@ -35,6 +35,6 @@
/* Sizes of things */
-#define MAX_MQUEUE_PATH 64
+#define MAX_MQUEUE_PATH (sizeof(CONFIG_FS_MQUEUE_VFS_PATH) + CONFIG_NAME_MAX +
1)
#endif /* __FS_MQUEUE_MQUEUE_H */