View Issue Details

IDProjectCategoryView StatusLast Update
00033323 - Current Dev ListBugpublic2019-06-15 22:43
ReporterK7ZCZAssigned ToK7ZCZ 
PrioritynormalSeveritycrashReproducibilityalways
Status assignedResolutionopen 
Product Version6.6.0.214 
Target VersionFixed in Version 
Summary0003332: QLM license code incorrectly casts string, ignores error return from Socaro function
DescriptionThis code is in LicenseValidator::WriteProductProperties():

string props = license->GetProductProperties(_bstr_t(""), _bstr_t(this->activationKey), &bstrResponse);


This code causes the application to crash because GetProductProperties() might return NULL, and NULL can't be successfully assigned to a std::string.

GetProductProperties() is declared to return a _bstr_t, which means an implicit cast is happening. That cast is dubious, since std::string is intended to represent a plain string (as compared to std::wstring which represents a wide dstring), while _bstr_t objects usually represent wide-character strings.

The correctness of the cast should be reviewed. The code should be fixed so that the error indicated by GetProductProperties() returning NULL is correctly handled and doesn't crash the application.

TagsNo tags attached.
ModuleSW License Mgmt
Sub-ModuleSW License Client
TestingNot Started

Relationships

related to 0003345 assigneddoug WriteProductProperties method in LicenseValidator catches all exceptions 

Activities

doug

2019-06-10 23:33

developer   ~0008036

Cleaned up the old code, not sure why the string was there any way, it was going BSTR->string->char*->then back to BSTR to be used. Looks like it works just fine as BSTR throughout, added the check for null, just returns false in that situation

doug

2019-06-11 21:11

developer   ~0008052

Changed to ....

_bstr_t bstrProps = license->GetProductProperties(_bstr_t(""), _bstr_t(this->activationKey), &bstrResponse);

        if (bstrProps.length())
        {


otherwise it returns false.

Does that work for you Mike?

Issue History

Date Modified Username Field Change
2019-06-07 09:49 K7ZCZ New Issue
2019-06-07 09:49 K7ZCZ Status new => assigned
2019-06-07 09:49 K7ZCZ Assigned To => doug
2019-06-09 19:02 WA9PIE Module All => QLM
2019-06-09 19:04 WA9PIE Sub-Module (select) => Software License Key System
2019-06-10 23:33 doug Note Added: 0008036
2019-06-11 08:34 K7ZCZ Relationship added related to 0003345
2019-06-11 21:11 doug Note Added: 0008052
2019-06-11 21:11 doug Assigned To doug => K7ZCZ
2019-06-13 14:47 WA9PIE Module QLM => SW License Mgmt
2019-06-15 11:21 WA9PIE Description Updated View Revisions
2019-06-15 11:21 WA9PIE Sub-Module Software License Key System => SW License Client