mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Sanity check: assert that row buffer length is not exceeded at a proper time, instead of dereferencing a broken pointer later on, which has random consequences (given that range checking is off).
This commit is contained in:
@@ -231,6 +231,10 @@ begin
|
||||
FColumnLengths[I] := GetColumnSize(Current);
|
||||
FColumnOffsets[I] := FColumnsSize;
|
||||
Inc(FColumnsSize, FColumnLengths[I] + 1);
|
||||
// 32768 is the length of a TByteArray.
|
||||
if FColumnsSize > 32767 then begin
|
||||
raise Exception.Create('Zeos: Row buffer width exceeded.\nTry using fewer or longer columns in SQL query.');
|
||||
end;
|
||||
FHasBlobs := FHasBlobs
|
||||
or (FColumnTypes[I] in [stAsciiStream, stUnicodeStream, stBinaryStream]);
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user