Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bdb5500

Browse files
authored
Fix unsafe use of NULL pointer
1 parent e73dfe1 commit bdb5500

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/file_compat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ static NPY_INLINE FILE *mpl_PyFile_Dup(PyObject *file, char *mode, mpl_off_t *or
9595
#endif
9696
if (handle == NULL) {
9797
PyErr_SetString(PyExc_IOError, "Getting a FILE* from a Python file object failed");
98+
return NULL;
9899
}
99100

100101
/* Record the original raw file handle position */

0 commit comments

Comments
 (0)