View Issue Details

IDProjectCategoryView StatusLast Update
0002929Ham Radio DeluxeBugpublic2018-11-11 00:34
ReporterK7ZCZ 
Assigned ToK7ZCZ 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version6.4.0.899 
Target VersionFixed in Version6.4.0.902 
Summary0002929: Logbook: Code in the DX Cluster implementation frees memory twice, uses uninitialized variables
DescriptionCopy-and-pasta code in the DX Cluster split implementation looks like this:

    LPTSTR lpszResult;
    HRDInterfaceFreeString(lpszResult = HRDInterfaceSendMessage(_T("get button-select Split")));

    BOOL	bSelect;
    if( lpszResult != NULL )
    {
        bSelect = _ttol(lpszResult);
    }

    if( bSelect == FALSE )
        HRDInterfaceFreeString(HRDInterfaceSendMessage(_T("set button-select Split %d"), TRUE));



We can see that the code frees the memory at lpszResult, but then dereferences that pointer. It's also possible that the bSelect variable hasn't been initialized when it is used in a conditional statement. Either flaw (or both, LOL!) can cause the Logbook to crash.
Steps To ReproduceCode review
TagsNo tags attached.
ModuleLogbook
Sub-ModuleDX Cluster
Testing Not Tested

Relationships

Activities

K7ZCZ

2018-11-02 12:37

manager   ~0006364

Unless we can find a way to exercise this code (a radio that enables DX Split, but isn't handled in one of the if-then cases) it'll be tough to test this externally.

K7ZCZ

2018-11-02 12:37

manager   ~0006365

fixed in this change set
https://hrdsoftware.visualstudio.com/HRD/_versionControl/changeset/4403

WA9PIE

2018-11-05 11:42

administrator   ~0006373

Accepted without testing, due to the nature of the change.

Issue History

Date Modified Username Field Change
2018-11-01 23:32 K7ZCZ New Issue
2018-11-02 12:37 K7ZCZ Note Added: 0006364
2018-11-02 12:37 K7ZCZ Assigned To => K7ZCZ
2018-11-02 12:37 K7ZCZ Status new => resolved
2018-11-02 12:37 K7ZCZ Resolution open => fixed
2018-11-02 12:37 K7ZCZ Note Added: 0006365
2018-11-04 07:49 K7ZCZ Fixed in Version => 6.4.0.900
2018-11-05 11:42 WA9PIE Status resolved => closed
2018-11-05 11:42 WA9PIE Description Updated View Revisions
2018-11-05 11:42 WA9PIE Testing Not Started => Not Tested
2018-11-05 11:42 WA9PIE Note Added: 0006373
2018-11-11 00:34 WA9PIE Fixed in Version 6.4.0.900 => 6.4.0.902
2018-11-11 00:34 WA9PIE Project 3 - Current Dev List => Ham Radio Deluxe