mmapstorage: additional error check if reading mmap file with OPMPHM from non-OPMPHM build
@@ -1383,6 +1383,12 @@ int ELEKTRA_PLUGIN_FUNCTION (get) (Plugin * handle ELEKTRA_UNUSED, KeySet * ks,
ELEKTRA_MMAP_LOG_WARNING ("mmap file written without OPMPHM, but reading from a build with OPMPHM");
goto error;
}
+#else
+ if (test_bit (mmapHeader->formatFlags, MMAP_FLAG_OPMPHM))
+ {
+ ELEKTRA_MMAP_LOG_WARNING ("mmap file written with OPMPHM, but reading from a build without OPMPHM");
+ goto error;
+ }
#endif
if (sbuf.st_size < 0 || (size_t) sbuf.st_size != mmapHeader->allocSize)
