mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-18 06:35:35 +03:00
Merge branch 'fix/vfs_missing_va_end_v5.4' into 'release/v5.4'
fix(storage/vfs): Remove va_end leak in ioctl caused by early return in macro (v5.4) See merge request espressif/esp-idf!45523
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -1058,10 +1058,22 @@ int esp_vfs_ioctl(int fd, int cmd, ...)
|
||||
__errno_r(r) = EBADF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (vfs->vfs->ioctl == NULL) {
|
||||
__errno_r(r) = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ret;
|
||||
va_list args;
|
||||
va_start(args, cmd);
|
||||
CHECK_AND_CALL(ret, r, vfs, ioctl, local_fd, cmd, args);
|
||||
|
||||
if (vfs->flags & ESP_VFS_FLAG_CONTEXT_PTR) {
|
||||
ret = vfs->vfs->ioctl_p(vfs->ctx, local_fd, cmd, args);
|
||||
} else {
|
||||
ret = vfs->vfs->ioctl(local_fd, cmd, args);
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user