mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
API: C: Check nullptr in icsneo_serialStringToNum
Otherwise it will implicitly call the std::string constructor and that constructor does not check nullptr.
This commit is contained in:
@@ -84,6 +84,9 @@ bool icsneo_serialNumToString(uint32_t num, char* str, size_t* count) {
|
||||
}
|
||||
|
||||
uint32_t icsneo_serialStringToNum(const char* str) {
|
||||
if(!str)
|
||||
return 0;
|
||||
|
||||
return Device::SerialStringToNum(str);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user