Jan Willamowius
2019-04-21 07bffd8cd6c89bc2e55124ef424b297834889753
don't write beyond buffer
1个文件已修改
8 ■■■■ 已修改文件
src/library/base/logger.c 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/library/base/logger.c
@@ -30,14 +30,14 @@
    if (folder == 0) {
        folder = "/tmp";
    }
    strcpy(logpath, folder);
    strcat(logpath, "/open-license.log");
    strncpy(logpath, folder, MAX_PATH);
    strncat(logpath, "/open-license.log", MAX_PATH - strlen(logpath));
#else
    int plen=GetTempPath(MAX_PATH,logpath);
    int plen = GetTempPath(MAX_PATH, logpath);
    if(plen == 0) {
        fprintf(stderr, "Error getting temporary directory path");
    }
    strcat(logpath,"open-license.log");
    strncat(logpath, "open-license.log", MAX_PATH - strlen(logpath));
#endif
}