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
0002378 [JEDI VCL] 00 JVCL Components major always 2004-12-13 15:14 2004-12-14 01:48
Reporter dbarros View Status public  
Assigned To
Priority normal Resolution fixed  
Status resolved   Product Version 3.00 BETA 2
Summary 0002378: TJvVersionInfo access violation reading properties when file does not exist.
Description When creating a TJvVersionInfo, and passing it a filename of a file that does not exists, access violations occur when subsequently trying to read some properties.
Additional Information Here is an example:

v := TJvVersionInfo.Create(Filename);
_comments := v.Comments;
_companyName := v.CompanyName;
_versionMajor := (HiWord(v.FileLongVersion.MS) shl 16) or (LoWord(v.FileLongVersion.MS));

When the file "Filename" does not exist, the component sets itself to an "Invalid" state. Most properties, like Comments and CompanyName, check its state and return a default even the Filename does not exist.

In the case of the FileLongVersion property, it does not do the check and contains code which is set to nil and hence causes access violations.

Here is a snippet from JvVersionInfo.pas which shows this:

function TJvVersionInfo.GetProductLongVersion: TLongVersion;
    Result.MS := FixedFileInfo^.dwProductVersionMS;
    Result.LS := FixedFileInfo^.dwProductVersionLS;

Tags No tags attached.
Attached Files ? file icon JvVersionInfo.pas [^] (12,241 bytes) 2004-12-13 15:50

- Relationships

-  Notes
dbarros (reporter)
2004-12-13 15:51

I have uploaded a fix in the attached file.
2004-12-14 01:48

Fixed in CVS

- Issue History
Date Modified Username Field Change
2004-12-13 15:14 dbarros New Issue
2004-12-13 15:35 dbarros Issue Monitored: dbarros
2004-12-13 15:50 dbarros File Added: JvVersionInfo.pas
2004-12-13 15:51 dbarros Note Added: 0005878
2004-12-14 01:48 user72 Status new => resolved
2004-12-14 01:48 user72 Resolution open => fixed
2004-12-14 01:48 user72 Assigned To => user72
2004-12-14 01:48 user72 Note Added: 0005881
2004-12-14 01:48 user72 Assigned To user72 =>

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