Anonymous | Login | Signup for a new account | 2019-02-21 03:50 CET |
Main | My View | View Issues | Change Log | Roadmap | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||
0004285 | [JEDI VCL] 00 JVCL Components | crash | always | 2007-10-31 12:54 | 2007-12-16 12:58 | ||
Reporter | locopablo | View Status | public | ||||
Assigned To | AHUser | ||||||
Priority | normal | Resolution | fixed | ||||
Status | resolved | Product Version | 3.32 | ||||
Summary | 0004285: TJvMemoryData causes access violation when assigning a WideString value to a TWideStringField | ||||||
Description |
Assigning a value to a WideString field causes an access violation. Sample code: memds := TJvMemoryData.Create(nil); try memds.FieldDefs.Add('ss', ftString, 20, False); memds.FieldDefs.Add('ws', ftWideString, 20, False); memds.Active := True; memds.Append; memds.Fields[0].Value := 'abc123'; // next line causes A/V memds.Fields[1].Value := 'abc123'; memds.Post; finally FreeAndNil(memds); end; |
||||||
Additional Information |
Failure seems to be caused by this function: procedure TJvMemoryData.DataConvert(Field: TField; Source, Dest: Pointer; ToNative: Boolean); begin if Field.DataType = ftWideString then begin // copied from DB.PAS - this works OK WStrCopy(PWideChar(Dest), PWideChar(Source)); { // Original code - crashes with A/V if ToNative then begin Word(Dest^) := Length(PWideString(Source)^) * 2; Move(PWideChar(Source^)^, (PWideChar(Dest) + 1)^, Word(Dest^)); end else SetString(WideString(Dest^), PWideChar(PChar(Source) + 2), Word(Source^) div 2); } end else inherited DataConvert(Field, Source, Dest, ToNative); end; |
||||||
Tags | No tags attached. | ||||||
Attached Files | |||||||
|
![]() |
||||||
|
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |