mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-27 05:37:32 +00:00
The esp_libc relies on the stdio implementation of the vfs component if CONFIG_VFS_SUPPORT_IO is enabled. This is not an issue in cmakev1 because if the vfs component is not included in the project build, its configuration is not available, and CONFIG_VFS_SUPPORT_IO is not set. However, in cmakev2, the configuration for all components is available, and the presence of some component configuration options does not necessarily mean that the component is included in the project build. When esp_libc is compiled without the vfs dependency but with CONFIG_VFS_SUPPORT_IO enabled, the libc initialization will encounter a panic due to a NULL pointer dereference (fp->_flags) in __swsetup_r, as fopen in esp_libc_init_global_stdio will return NULL.