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;
  SubKey: string;
  ValueName: string;
  SplitKeyPath(Path, SubKey, ValueName);
  Result := RegReadBinary(FRegHKEY, SubKey, ValueName, Buf^, BufSize);

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

- Relationships

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

This bug was introduced when the function's prototypes were changed.
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.
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