summaryrefslogtreecommitdiff
path: root/plugins/HistoryPlusPlus
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/HistoryPlusPlus')
-rw-r--r--plugins/HistoryPlusPlus/hpp_events.pas13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/HistoryPlusPlus/hpp_events.pas b/plugins/HistoryPlusPlus/hpp_events.pas
index c4dde1817d..2f980162f0 100644
--- a/plugins/HistoryPlusPlus/hpp_events.pas
+++ b/plugins/HistoryPlusPlus/hpp_events.pas
@@ -385,14 +385,21 @@ begin
BlobSize := db_event_getBlobSize(hDBEvent);
if BlobSize > 0 then
begin
- EventBuffer.Allocate(BlobSize);
+ EventBuffer.Allocate(BlobSize+2); // cheat, for possible crash avoid
Result.pBlob := EventBuffer.Buffer;
end
else
BlobSize := 0;
- Result.cbBlob := BlobSize;
+
if db_event_get(hDBEvent, @Result) = 0 then
- Result.cbBlob := BlobSize
+ begin
+ Result.cbBlob := BlobSize;
+ if BlobSize > 0 then
+ begin
+ PAnsiChar(Result.pBlob)[BlobSize ]:=#0;
+ PAnsiChar(Result.pBlob)[BlobSize+1]:=#0;
+ end;
+ end
else
Result.cbBlob := 0;
end;