]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix unsafe usage of string data on Android
authorPo Lu <luangruo@yahoo.com>
Wed, 29 May 2024 09:11:11 +0000 (17:11 +0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 29 May 2024 10:12:44 +0000 (12:12 +0200)
* src/dired.c (open_directory): Reload name after calling
maybe_quit, which might invoke GC.

(cherry picked from commit b8d880e059252541be0017523fc1ffa2251bb542)

src/dired.c

index 2736b6639be41c005161539cf021d8e7ddcebc91..61ad81cbe5870cbccaaab7e91ac46c276475e9cd 100644 (file)
@@ -126,6 +126,10 @@ open_directory (Lisp_Object dirname, Lisp_Object encoded_dirname, int *fdp)
   else if (errno == EINTR)
     {
       maybe_quit ();
+
+      /* Reload the address of DIRNAME's data, as it might have been
+        relocated by GC.  */
+      name = SSDATA (dirname);
       goto again;
     }
 #endif