q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=21790b055b37fb8949d33d60ebec9bb5d800a633

commit 21790b055b37fb8949d33d60ebec9bb5d800a633
Author: Daniel Kolesa <[email protected]>
Date:   Sun May 26 18:30:02 2019 +0200

    eolian: prevent parsing when eo file version is too new
---
 src/lib/eolian/Eolian.h    | 3 +++
 src/lib/eolian/eo_parser.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index fdda984aef..a612f3af1c 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -84,6 +84,9 @@ extern "C" {
 
 #ifdef EFL_BETA_API_SUPPORT
 
+/* The maximum format version supported by this version of Eolian */
+#define EOLIAN_FILE_FORMAT_VERSION 1
+
 /* State information
  *
  * Possible to cast to Eolian_Unit and use as such, as this represents
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 74c76d3a7d..4fc14be886 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -2300,6 +2300,8 @@ parse_chunk(Eo_Lexer *ls, Eina_Bool eot)
                eo_lexer_syntax_error(ls, "#version too low");
 
              ls->unit->version = (unsigned short)(ls->t.value.u);
+             if (ls->unit->version > EOLIAN_FILE_FORMAT_VERSION)
+               eo_lexer_syntax_error(ls, "file version too new for this 
version of Eolian");
              eo_lexer_get(ls);
              break;
            }

-- 


Reply via email to