From a02a269a7beeee831074d89878c3c13f9dde0605 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 18 Nov 2014 13:47:53 +0100 Subject: [PATCH] fix possible AV in patchPlatform paths --- src/ce_common.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ce_common.pas b/src/ce_common.pas index de9d8449..c7d8e171 100644 --- a/src/ce_common.pas +++ b/src/ce_common.pas @@ -474,6 +474,8 @@ function patchPlateformExt(const aFilename: string): string; var ext, newext: string; begin + if aFilename = '' then exit(aFilename); + // ext := extractFileExt(aFilename); newext := ''; result := aFilename[1..length(aFilename)-length(ext)]; @@ -754,13 +756,13 @@ begin // temp fix: messages are cut if the TAsyncProcess version is used on simple TProcess. if aProcess is TAsyncProcess then begin while aProcess.Output.NumBytesAvailable <> 0 do begin - str.Size := sum + buffSz; + str.SetSize(sum + buffSz); cnt := aProcess.Output.Read((str.Memory + sum)^, buffSz); sum += cnt; end; end else begin repeat - str.Size := sum + buffSz; + str.SetSize(sum + buffSz); cnt := aProcess.Output.Read((str.Memory + sum)^, buffSz); sum += cnt; until