浏览代码

LibCore: Make CFile::open() assert that the filename is non-null

Andreas Kling 5 年之前
父节点
当前提交
74bba649c3
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Libraries/LibCore/CFile.cpp

+ 1 - 0
Libraries/LibCore/CFile.cpp

@@ -26,6 +26,7 @@ bool CFile::open(int fd, CIODevice::OpenMode mode, ShouldCloseFileDescription sh
 
 bool CFile::open(CIODevice::OpenMode mode)
 {
+    ASSERT(!m_filename.is_null());
     int flags = 0;
     if ((mode & CIODevice::ReadWrite) == CIODevice::ReadWrite) {
         flags |= O_RDWR | O_CREAT;