From a7f5c37a63475511ceefe77bb97f3a19302cc353 Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Thu, 15 Aug 2024 16:04:07 +0800 Subject: [PATCH] v9fs/client.c:fix in x86 qemu crash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: In the x86 environment, memory does not necessarily start at 0, so when end is 0x0, start = end + 1, and then determine the contents of start, it will cause x86 to cause a crash when accessing an illegal address. This problem does not occur in the arm environment because arm starts at 0x0, so the content of the 0x1 address is “\0”. Signed-off-by: chenrun1 --- fs/v9fs/client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/v9fs/client.c b/fs/v9fs/client.c index 41e049f533..ca2f35d496 100644 --- a/fs/v9fs/client.c +++ b/fs/v9fs/client.c @@ -1555,6 +1555,7 @@ int v9fs_client_walk(FAR struct v9fs_client_s *client, FAR const char *path, } name_len = strlen(start); + end = start + name_len - 1; } else {