Skip to content

Commit 1d574c2

Browse files
committed
change from review
1 parent 9b0fa9c commit 1d574c2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/fileinfo/fileinfo.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ static const char* php_fileinfo_from_path(struct magic_set *magic, const zend_st
283283
ZEND_ASSERT(path);
284284
ZEND_ASSERT(ZSTR_LEN(path) != 0);
285285
ZEND_ASSERT(!zend_str_has_nul_byte(path));
286+
ZEND_ASSERT(context != NULL);
286287

287288
/* determine if the file is a local file or remote URL */
288289
const char *dummy;
@@ -343,6 +344,9 @@ PHP_FUNCTION(finfo_file)
343344
RETURN_THROWS();
344345
}
345346
php_stream_context *context = php_stream_context_from_zval(zcontext, false);
347+
if (!context) {
348+
RETURN_THROWS();
349+
}
346350

347351
/* Set options for the current file/buffer. */
348352
if (options) {

0 commit comments

Comments
 (0)