Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002854 [JEDI VCL] 00 JVCL Components crash always 2005-04-09 17:46 2005-04-10 16:07
Reporter timschat View Status public  
Assigned To outchy
Priority normal Resolution fixed  
Status resolved   Product Version 3.00
Summary 0002854: Reading and Writing binary data from registry using TJvAppRegistryStorage causes AV
Description The issue is caused by a misunderstanding of pointer passing. The corrected code looks as follows:

function TJvAppRegistryStorage.DoReadBinary(const Path: string; Buf: Pointer; BufSize: Integer): Integer;
var
  SubKey: string;
  ValueName: string;
begin
  SplitKeyPath(Path, SubKey, ValueName);
  Result := RegReadBinary(FRegHKEY, SubKey, ValueName, Buf^, BufSize);
end;

procedure TJvAppRegistryStorage.DoWriteBinary(const Path: string; Buf: Pointer; BufSize: Integer);
var
  SubKey: string;
  ValueName: string;
begin
  SplitKeyPath(Path, SubKey, ValueName);
  CreateKey(SubKey);
  RegWriteBinary(FRegHKEY, SubKey, ValueName, Buf^, BufSize);
end;
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0006881)
outchy (administrator)
2005-04-10 13:13

This bug was introduced when the function's prototypes were changed.
(0006883)
outchy (administrator)
2005-04-10 13:33

This bug caused no AV on my machine (addresses were still valid), but it was address to address which cause erratic behaviour (the code was writting the low order byte of the address, not the content pointed).
I didn't have any AV running my tests because the data size was below 4 bytes, there may be AV if the data size was above or equal 4 bytes.

Bug fixed in the CVS.
(0006884)
anonymous (viewer)
2005-04-10 13:59

Jep, actually I think everything >4 bytes messes up the stack. But good to hear its fixed :)

- Issue History
Date Modified Username Field Change
2005-04-09 17:46 timschat New Issue
2005-04-10 13:13 outchy Note Added: 0006881
2005-04-10 13:13 outchy Status new => confirmed
2005-04-10 13:33 outchy Note Added: 0006883
2005-04-10 13:59 anonymous Note Added: 0006884
2005-04-10 16:07 outchy Status confirmed => resolved
2005-04-10 16:07 outchy Resolution open => fixed
2005-04-10 16:07 outchy Assigned To => outchy


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker