Jan Willamowius
2019-04-21 d18bd4d54eeac832092936e9ccfc683098cf74af
leave room for terminating nul byte
1个文件已修改
4 ■■■■ 已修改文件
src/library/LicenseReader.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/library/LicenseReader.cpp
@@ -69,7 +69,7 @@
    }
    if (has_client_sig) {
        PcSignature str_code;
        strncpy(str_code, client_signature.c_str(), sizeof(str_code));
        strncpy(str_code, client_signature.c_str(), sizeof(str_code)-1);
        EVENT_TYPE event = validate_pc_signature(str_code);
        if (event != LICENSE_OK) {
            er.addEvent(event, SVRT_ERROR);
@@ -89,7 +89,7 @@
            license->expiry_date[0] = '\0';
            license->days_left = 999999;
        } else {
            strncpy(license->expiry_date, to_date.c_str(), 11);
            strncpy(license->expiry_date, to_date.c_str(), 11-1);
            double secs = difftime(
                seconds_from_epoch(to_date.c_str()),
                time(NULL));