View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003344 | JEDI VCL | 00 JVCL Components | public | 2005-12-06 15:51 | 2005-12-19 17:16 |
Reporter | Thomas | Assigned To | AHUser | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.00 | ||||
Target Version | Fixed in Version | 3.20 | |||
Summary | 0003344: TJvCustomCipher EncodeString / DecodeString broken (but easy fix) | ||||
Description | With " function TJvCustomCipher.EncodeString(const Key, Value: string): string; var Tmp: PChar; begin GetMem(Tmp, Length(Value) + 1); try StrPCopy(Tmp, Value); Encode(Key, Tmp, Length(Value)); Result := Tmp; finally FreeMem(Tmp); end; end; " The problem is the line "Result := Tmp;" since that can potentially cut a lof of the string. (if *Tmp* contains a #0 the whole stirng is not copied - at least I experienced this running it on a 20 kb string.) | ||||
Additional Information | I propose solution: " SetLength(Result, Length(Value)); FillChar(Result[1], Length(Value), 0); Move(Tmp^, Result[1], Length(Value)); " The same fix for *TJvCustomCipher.DecodeString(const Key, Value: string)*. best regards Thomas Schulz | ||||
Tags | No tags attached. | ||||