Return error on fopen(NULL)

https://sqlite.org/forum/forumpost/d1c96a9032e564f8
This commit is contained in:
Justine Tunney 2023-01-08 15:17:44 -08:00
parent 7ab4630cc9
commit 2bad436abf
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
2 changed files with 13 additions and 9 deletions

View file

@ -58,6 +58,10 @@ FILE *fopen(const char *pathname, const char *mode) {
FILE *f = 0;
bool noclose;
int fd, flags;
if (!pathname) {
efault();
return 0;
}
flags = fopenflags(mode);
pathname = fixpathname(pathname, flags);
if ((fd = openpathname(pathname, flags, &noclose)) != -1) {