File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ CHANGELOG
77* Improve the error handling when the user tries to open a directory
88 with the pure PHP reader.
99* Improve the typehints on arrays in the PHPDocs.
10+ * The C extension now checks that the database metadata lookup was
11+ successful.
1012
11131.11.1 (2023-12-01)
1214-------------------
Original file line number Diff line number Diff line change @@ -336,7 +336,15 @@ PHP_METHOD(MaxMind_Db_Reader, metadata) {
336336 object_init_ex (return_value , metadata_ce );
337337
338338 MMDB_entry_data_list_s * entry_data_list ;
339- MMDB_get_metadata_as_entry_data_list (mmdb_obj -> mmdb , & entry_data_list );
339+ int status =
340+ MMDB_get_metadata_as_entry_data_list (mmdb_obj -> mmdb , & entry_data_list );
341+ if (status != MMDB_SUCCESS ) {
342+ zend_throw_exception_ex (maxminddb_exception_ce ,
343+ 0 TSRMLS_CC ,
344+ "Error while decoding metadata. %s" ,
345+ MMDB_strerror (status ));
346+ return ;
347+ }
340348
341349 zval metadata_array ;
342350 const MMDB_entry_data_list_s * rv =
You can’t perform that action at this time.
0 commit comments