Lack of nullptr check in /src/node_file.cc ReadDir

Version

main

Platform

Subsystem

No response

What steps will reproduce the bug?

In function ReadDir not checked for nullptr. It may cause null pointer dereference.

FSReqBase* req_wrap_async = GetReqWrap(args, 3);
ASYNC_THROW_IF_INSUFFICIENT_PERMISSIONS(
env,
req_wrap_async,
permission::PermissionScope::kFileSystemRead,
path.ToStringView());
req_wrap_async->set_with_file_types(with_types);

How often does it reproduce? Is there a required condition?

GetReqWrap returns null

What is the expected behavior? Why is that the expected behavior?

Checking result of GetReqWrap against nullptr

What do you see instead?

Lack of check

Additional information

No response