Skip to content

Commit

Permalink
Merge pull request #72 from SeanMcG/scripthandler-null-deref
Browse files Browse the repository at this point in the history
ScriptHandler: prevent a null pointer dereference in fopen()
  • Loading branch information
Galladite27 authored Sep 18, 2024
2 parents 294909b + e654384 commit cd87a5e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ScriptHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ FILE *ScriptHandler::fopen( const char *path, const char *mode, const bool save,

fp = ::fopen( file_name, mode );
} else {
if (archive_path == NULL) {
return NULL;
}
// search within archive_path(s)
file_name = new char[archive_path->max_path_len()+strlen(path)+1];
for (int n=0; n<archive_path->get_num_paths(); n++) {
Expand Down

0 comments on commit cd87a5e

Please sign in to comment.