mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 20:14:45 +00:00
fix(bootstrap): add bounds check to extractBalancedBraceContent
Return null when startPos exceeds string length to prevent out-of-bounds access. Add comprehensive test coverage for environment variable parsing edge cases.
This commit is contained in:
1 parent
9b7e2e15b0
commit
059164224c
2 files changed
+354
No files matched your search
@@ -28,6 +28,9 @@ function collectRegex(string $name)
|
||||
function extractBalancedBraceContent(string $str, int $startPos = 0): ?array
|
||||
{
|
||||
// Find opening brace
|
||||
if ($startPos >= strlen($str)) {
|
||||
return null;
|
||||
}
|
||||
$openPos = strpos($str, '{', $startPos);
|
||||
if ($openPos === false) {
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user