src: limit GetProcessTitle() result to 1MB
GetProcessTitle()
otherwise runs an infinite loop when
uv_setup_argv()
has not been called (yet). This is a problem
e.g. in assertions from static constructors, which run before
main()
and thus before argc
and argv
become available.
To solve that, do not allocate more than 1MB of storage for the title and bail out if we reach that point.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines