View Issue Details

IDProjectCategoryView StatusLast Update
0005180JEDI VCL00 JVCL Componentspublic2011-06-10 16:09
ReporterjkelleyAssigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.39 
Target VersionFixed in Version3.40 
Summary0005180: TJvAppRegistryStorage.ReadDateTime is not very robust
DescriptionIf configured to store DateTime values as strings, then ReadDateTime will fall back to reading a float value if converting the string value to a DateTime fails. However, from what I can tell in testing, TJvAppRegistryStorage.DoReadFloat will successfully read from a string registry entry as long as the string is no more than 4 characters in size.

As a result, TJvAppRegistryStorage.ReadDateTime will read corrupted or truncated string-formatted DateTime values, returning incorrect results, as long as the values are no more than 4 characters long.
TagsNo tags attached.

Activities

jfudickar

2010-02-24 21:54

developer   ~0017216

Did you have a better suggestion?

jkelley

2010-02-24 22:12

reporter   ~0017217

It would make sense to me for TJvAppRegistryStorage.DoReadFloat to require that the registry value be a REG_BINARY that's exactly SizeOf(Extended) bytes long.

That's the format created by TJvAppRegistryStorage.DoWriteFloat, so it should be safe.

I'm really not familiar with TJvAppRegistryStorage - I came across this issue with ReadDateTime while trying to diagnose an error being raised by TJvProgramVersionCheck, which uses TJvAppStorage - so this suggestion may have problems that I'm not aware of.

obones

2010-03-09 11:03

administrator   ~0017271

Having the zipped sources of a sample application showing this would help greatly

AHUser

2010-04-02 14:23

developer   ~0017351

Fixed in SVN. DoReadFloat now only accepts REG_BINARY as datatype

Issue History

Date Modified Username Field Change
2010-02-24 17:16 jkelley New Issue
2010-02-24 21:54 jfudickar Note Added: 0017216
2010-02-24 22:12 jkelley Note Added: 0017217
2010-03-09 11:03 obones Note Added: 0017271
2010-03-09 11:03 obones Status new => feedback
2010-04-02 14:23 AHUser Note Added: 0017351
2010-04-02 14:23 AHUser Status feedback => resolved
2010-04-02 14:23 AHUser Fixed in Version => Daily / SVN
2010-04-02 14:23 AHUser Resolution open => fixed
2010-04-02 14:23 AHUser Assigned To => AHUser
2011-06-10 16:09 obones Fixed in Version Daily / SVN => 3.40