From 4f82d8b5bdff98e741efa70867d925dd0b397eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Edelbo?= Date: Tue, 27 Feb 2024 15:01:25 +0100 Subject: [PATCH] Prevent opening files with file format 23 in read-only mode --- CHANGELOG.md | 2 ++ src/realm/group.cpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60c2536f1e5..14ed20fe0d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,12 +7,14 @@ ### Fixed * ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?) * List KVO information was being populated for non-list collections ([PR #7378](https://github.com/realm/realm-core/pull/7378), since v14.0.0) +* Opening file with file format 23 in read-only mode will crash ([#7388](https://github.com/realm/realm-core/issues/7388), since v14.0.0) ### Breaking changes * None. ### Compatibility * Fileformat: Generates files with format v24. Reads and automatically upgrade from fileformat v10. If you want to upgrade from an earlier file format version you will have to use RealmCore v13.x.y or earlier. + You cannot open files with an file format older than v24 in read-only mode. ----------- diff --git a/src/realm/group.cpp b/src/realm/group.cpp index 8252bb43b34..b66d49e1801 100644 --- a/src/realm/group.cpp +++ b/src/realm/group.cpp @@ -325,7 +325,7 @@ int Group::get_target_file_format_version_for_session(int current_file_format_ve // individual file format versions. if (requested_history_type == Replication::hist_None) { - if (current_file_format_version == 23) { + if (current_file_format_version == 24) { // We are able to open these file formats in RO mode return current_file_format_version; } @@ -419,7 +419,6 @@ int Group::read_only_version_check(SlabAlloc& alloc, ref_type top_ref, const std case 0: file_format_ok = (top_ref == 0); break; - case 23: case g_current_file_format_version: file_format_ok = true; break;