Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/common/dmod_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ bool Dmod_ApiSignature_ReadModuleName( const char* Signature, char* ModuleName,
{
return false;
}
if( ModuleName == NULL )
{
return false;
}
if( !Dmod_ApiSignature_IsValid( Signature ) )
{
return false;
Expand Down Expand Up @@ -275,6 +279,10 @@ bool Dmod_ApiSignature_ReadVersion( const char* Signature, char* Version, size_t
{
return false;
}
if( Version == NULL )
{
return false;
}
if( !Dmod_ApiSignature_IsValid( Signature ) )
{
return false;
Expand Down Expand Up @@ -315,6 +323,10 @@ bool Dmod_ApiSignature_ReadModuleVersion( const char* Signature, char* ModuleVer
{
return false;
}
if( ModuleVersion == NULL )
{
return false;
}
if( !Dmod_ApiSignature_IsValid( Signature ) )
{
return false;
Expand Down Expand Up @@ -500,6 +512,11 @@ static bool ApiSignature_AreModulesEqual( const char* Signature1, const char* Si
const char* module1 = ApiSignature_GetModule( Signature1 );
const char* module2 = ApiSignature_GetModule( Signature2 );

if( module1 == NULL || module2 == NULL )
{
return module1 == module2;
}

while( *module1 != '\0' && *module2 != '\0' && *module1 != ':' && *module2 != ':' )
{
if( *module1 != *module2 )
Expand All @@ -526,6 +543,11 @@ static bool ApiSignature_AreApiVersionsCompatible( const char* Signature1, const
const char* version1 = ApiSignature_GetVersion( Signature1 );
const char* version2 = ApiSignature_GetVersion( Signature2 );

if( version1 == NULL || version2 == NULL )
{
return version1 == version2;
}

while( *version1 != '\0' && *version2 != '\0' && *version1 != '/' && *version2 != '/' && *version1 != '.' && *version2 != '.' )
{
if( *version1 != *version2 )
Expand Down Expand Up @@ -553,6 +575,11 @@ static bool ApiSignature_AreModuleVersionsCompatible( const char* Signature1, co
const char* moduleVersion1 = ApiSignature_GetModuleVersion( Signature1 );
const char* moduleVersion2 = ApiSignature_GetModuleVersion( Signature2 );

if( moduleVersion1 == NULL || moduleVersion2 == NULL )
{
return moduleVersion1 == moduleVersion2;
}

while( *moduleVersion1 != '\0' && *moduleVersion2 != '\0' && *moduleVersion1 != '.' && *moduleVersion2 != '.' )
{
if( *moduleVersion1 != *moduleVersion2 )
Expand Down
1 change: 1 addition & 0 deletions tests/system/public/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ set(TEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/tests_dmod_loadfile_package_path.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests_dmod_irq.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests_dmod_verify_apis.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests_dmod_api_signature.cpp
PARENT_SCOPE
)
Loading
Loading