fundamentalslib / fundamentals5

Fundamentals 5 Code Library for FreePascal and Delphi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HugeWordAssignBufStrB / HugeWordAssignBufStr works wrong with short buffers

DenisDx opened this issue · comments

Hello!

Thank you for a great library!

I found a bug in the functions HugeWordAssignBufStrB and HugeWordAssignBufStr
it adds 0x013F00 to the short buffers

How to repeat:
pass a single byte buffer to the function, e.g., #1

A "patch" that fixes the problem (just add zeros)
raw := StringOfChar(#0,3) + raw;
HugeWordAssignBufStrB(BN, raw, True);

I think, it is related to a memory corruption bug in HugeWordAssignBuf(). See #42 .