Unverified Commit 18af0b0f authored by Anna Henningsen's avatar Anna Henningsen
Browse files

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.

PR-URL: https://github.com/nodejs/node/pull/35492


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarGus Caplan <me@gus.host>
Reviewed-By: default avatarTobias Nießen <tniessen@tnie.de>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent b5490d02
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment