diff --git a/fs/vfs/fs_open.c b/fs/vfs/fs_open.c index 08a3f24f64..a66f62e869 100644 --- a/fs/vfs/fs_open.c +++ b/fs/vfs/fs_open.c @@ -260,6 +260,7 @@ int open(const char *path, int oflags, ...) */ fd = (int)OPEN_GETFD(ret); + DEBUGASSERT((unsigned)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS)); } #endif