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-apps.git
commit ca64e08b3799168866dc4417b51ae28b1597916f Author: p-zhangzhaojun <[email protected]> AuthorDate: Sat Nov 9 19:51:02 2024 +0800 [stability]:Fixed bug that validity of coredump dumpfile_is_valid() tells whether a file of the save path is a core file, but it returned true when the name does not end with COREDUMP_FILE_SUFFIX, since memcmp() returns 0 on a match. coredump_restore() therefore counted the other files of the save path against maxfile and removed them to make room, while it never counted or removed the old core files. Return true when the suffix matches. Assisted-by: Kiro:claude-opus-5-5 Signed-off-by: p-zhangzhaojun <[email protected]> --- system/coredump/coredump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/coredump/coredump.c b/system/coredump/coredump.c index 5ad825ac1..e4e1c5189 100644 --- a/system/coredump/coredump.c +++ b/system/coredump/coredump.c @@ -93,7 +93,7 @@ static bool dumpfile_is_valid(FAR const char *name) } suffix = name + name_len - COREDUMP_FILE_SUFFIX_LEN; - return !!memcmp(suffix, COREDUMP_FILE_SUFFIX, COREDUMP_FILE_SUFFIX_LEN); + return !memcmp(suffix, COREDUMP_FILE_SUFFIX, COREDUMP_FILE_SUFFIX_LEN); } static int dumpfile_iterate(FAR char *path, dumpfile_cb_t cb, FAR void *arg)
