API: C: Check nullptr in icsneo_serialStringToNum

Otherwise it will implicitly call the std::string constructor
and that constructor does not check nullptr.
pull/35/head
Paul Hollinsky 2021-06-11 13:06:47 -04:00
parent f3e456e7ea
commit a43c0117d6
1 changed files with 3 additions and 0 deletions

View File

@ -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);
}