Files
nagachika 72d9d4b935 merge revision(s) 670f6c1541: [Backport #22479]
[PATCH] Keep the symlink target alive while realpath_rec reads it

	realpath_rec reads the names of a symlink target through a raw pointer
	into the string returned by rb_readlink, while it calls itself to resolve
	those names. RB_GC_GUARD(link_orig) keeps that string alive only for an
	absolute target. For a relative target, link_orig is Qnil and nothing
	uses `link` after the recursive call, so GC can free the string while the
	later names are still being read.

	File.realdirpath then returns a wrong path: the unresolved symlink path,
	or a path with NUL bytes, which makes Pathname.new raise "pathname
	contains null byte". CocoaPods calls Pathname#realdirpath for every
	source file, and pnpm installs packages behind relative symlinks, so
	`pod install` fails at random in such projects.

	File.realpath is not affected on platforms with realpath(3), because only
	RB_REALPATH_DIR uses realpath_rec there.

	Fixes [Bug #22479]
2026-10-28 21:31:46 +09:00
..
2024-11-05 23:04:49 +09:00
2025-02-27 09:00:25 -08:00
2023-12-23 05:56:02 +09:00
2025-04-03 15:32:20 -07:00
2024-11-25 08:00:03 +00:00
2026-05-16 10:23:35 +09:00
2024-11-20 16:59:55 +00:00
2026-08-30 19:18:36 +09:00
2025-10-07 09:15:46 -07:00
2024-10-16 17:04:37 +09:00
2026-03-07 14:50:06 +09:00
2024-01-22 15:59:40 +09:00