Check the snprintf() return value.
The build was successful. Details

This commit is contained in:
Piotr Likoski 2019-07-12 14:10:09 +02:00
부모 d96dcdf1e0
커밋 33b0f20573
로그인 계정: likoski
GPG 키 ID: D9556DDD74910B18
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제

파일 보기

@ -634,7 +634,10 @@ static sxi32 ProcessSourceFile(
/* Install local import path which is the current directory */
ph7_vm_config(pVm, PH7_VM_CONFIG_IMPORT_PATH, "./");
if(zFilePath && SyRealPath(zFilePath, fFilePath) == PH7_OK) {
snprintf(pFilePath, sizeof(pFilePath) - 1, "%s", fFilePath);
rc = snprintf(pFilePath, sizeof(pFilePath) - 1, "%s", fFilePath);
if(rc < 0) {
goto Release;
}
/* Extract directory name containing processed file */
pFileDir = (char *) PH7_ExtractDirName(fFilePath, SyStrlen(fFilePath), &iFileDir);
pFileDir[iFileDir + 1] = '\0';