File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1151,6 +1151,16 @@ void PAG_header_init(thread_db* tdbb)
11511151 if (header->hdr_page_size < MIN_PAGE_SIZE || header->hdr_page_size > MAX_PAGE_SIZE)
11521152 ERR_post (Arg::Gds (isc_bad_db_format) << Arg::Str (attachment->att_filename ));
11531153
1154+ if (header->hdr_page_size % MIN_PAGE_SIZE != 0 )
1155+ ERR_post (Arg::Gds (isc_bad_db_format) << Arg::Str (attachment->att_filename ));
1156+
1157+ // Pagespace is already created at this point, so validate the database file
1158+ // to contain at least one full page
1159+ const auto pageSpace = dbb->dbb_page_manager .findPageSpace (DB_PAGE_SPACE);
1160+ fb_assert (pageSpace && pageSpace->file );
1161+ if (!PIO_get_number_of_pages (pageSpace->file , header->hdr_page_size ))
1162+ ERR_post (Arg::Gds (isc_bad_db_format) << Arg::Str (attachment->att_filename ));
1163+
11541164 dbb->dbb_ods_version = ods_version;
11551165 dbb->dbb_minor_version = header->hdr_ods_minor ;
11561166
You can’t perform that action at this time.
0 commit comments