desktop/unx/source/start.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit b4295077072cb4ccce167cf1e02a6477c2d65f0c Author: Caolán McNamara <[email protected]> AuthorDate: Thu Aug 29 20:24:57 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Sep 2 21:15:36 2024 +0200 cid#1608081 silence Overflowed array index write Change-Id: I3d44664c4a54797911a1be6bb0b0feb5ccd15b71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172773 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index 9094ca228a08..a8d6b9ff0139 100644 --- a/desktop/unx/source/start.c +++ b/desktop/unx/source/start.c @@ -516,10 +516,10 @@ static ProgressStatus read_percent(ChildInfo const *info, int *pPercent) memmove(pBuffer, pNext, nNotProcessed); /* read data */ - nRead = read(child_info_get_status_fd(info), - pBuffer + nNotProcessed, BUFFER_LEN - nNotProcessed); + ssize_t nThisRead = read(child_info_get_status_fd(info), + pBuffer + nNotProcessed, BUFFER_LEN - nNotProcessed); - if (nRead < 0) + if (nThisRead < 0) { if (errno == EINTR) return ProgressContinue; @@ -527,7 +527,7 @@ static ProgressStatus read_percent(ChildInfo const *info, int *pPercent) return ProgressExit; } - nRead += nNotProcessed; + nRead = nThisRead + nNotProcessed; pBuffer[nRead] = ' /* skip old data */
