From cd47c2446f1a9dee96610f298989848f8986a8be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 00:55:52 +0200 Subject: Merging upstream version 7.0.16-dfsg. Signed-off-by: Daniel Baumann --- src/VBox/Runtime/common/path/RTPathGlob.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/VBox/Runtime/common/path/RTPathGlob.cpp') diff --git a/src/VBox/Runtime/common/path/RTPathGlob.cpp b/src/VBox/Runtime/common/path/RTPathGlob.cpp index 46a634b2..16527527 100644 --- a/src/VBox/Runtime/common/path/RTPathGlob.cpp +++ b/src/VBox/Runtime/common/path/RTPathGlob.cpp @@ -486,7 +486,7 @@ static DECLCALLBACK(int) rtPathVarQuery_Path(uint32_t iItem, char *pszBuf, size_ #endif if (rc == VERR_BUFFER_OVERFLOW) { - for (uint32_t iTry = 0; iTry < 10; iTry++) + for (uint32_t iTry = 0;; iTry++) { size_t cbPathBuf = RT_ALIGN_Z(cchActual + 1 + 64 * iTry, 64); pszPathFree = (char *)RTMemTmpAlloc(cbPathBuf); @@ -495,6 +495,8 @@ static DECLCALLBACK(int) rtPathVarQuery_Path(uint32_t iItem, char *pszBuf, size_ break; RTMemTmpFree(pszPathFree); AssertReturn(cchActual >= cbPathBuf, VERR_INTERNAL_ERROR_3); + if (iTry >= 9) + return rc; } pszPath = pszPathFree; } -- cgit v1.2.3