summaryrefslogtreecommitdiffstats
path: root/src/VBox/Runtime/common/path/RTPathGlob.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 22:55:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 22:55:46 +0000
commit96647a898d62d699808316238dfb933d960413f2 (patch)
tree0138491ada40b7b3fcb80d4b219fa7922ae8f512 /src/VBox/Runtime/common/path/RTPathGlob.cpp
parentAdding debian version 7.0.14-dfsg-4. (diff)
downloadvirtualbox-96647a898d62d699808316238dfb933d960413f2.tar.xz
virtualbox-96647a898d62d699808316238dfb933d960413f2.zip
Merging upstream version 7.0.16-dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/Runtime/common/path/RTPathGlob.cpp')
-rw-r--r--src/VBox/Runtime/common/path/RTPathGlob.cpp4
1 files changed, 3 insertions, 1 deletions
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;
}