소스 검색

* Avoid doing a syscall with a nil parameter in fileexists

git-svn-id: trunk@44090 -
joost 5 년 전
부모
커밋
e7f5b89c2c
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      rtl/unix/sysutils.pp

+ 3 - 0
rtl/unix/sysutils.pp

@@ -662,6 +662,9 @@ var
   SystemFileName: RawByteString;
   isdir: Boolean;
 begin
+  // Do not call fpAccess with an empty name. (Valgrind will complain)
+  if Filename='' then
+    Exit(False);
   SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
   // Don't use stat. It fails on files >2 GB.
   // Access obeys the same access rules, so the result should be the same.