GptpIniParser::iniCallBack()
.../common/gptp_cfg.cpp
if( parseMatch(name, "priority1") )
{
errno = 0;
char *pEnd;
unsigned char p1 = (unsigned char) strtoul(value, &pEnd, 10);
if( *pEnd == '\0' && errno == 0) {
valOK = true;
parser->_config.priority1 = p1;
}
}
strtoul(value, &pEnd, 10) could be 256 or higher.
Values 256 or higher cannot be stored as unsigned char. Casting them to unsigned char can cause data loss or sign change.