stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=289cd1f3d499f3f587bed2954dc5d878f75e0c68

commit 289cd1f3d499f3f587bed2954dc5d878f75e0c68
Author: Felipe Magno de Almeida <fel...@expertisesolutions.com.br>
Date:   Thu Aug 15 20:47:23 2019 +0000

    eolian-cxx: Fix use after free for base variable
    
    T8137
    Differential Revision: https://phab.enlightenment.org/D9575
---
 src/bin/eolian_cxx/eolian_cxx.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/bin/eolian_cxx/eolian_cxx.cc b/src/bin/eolian_cxx/eolian_cxx.cc
index 1e0842873d..6f719f178f 100644
--- a/src/bin/eolian_cxx/eolian_cxx.cc
+++ b/src/bin/eolian_cxx/eolian_cxx.cc
@@ -287,10 +287,10 @@ run(options_type const& opts)
      {
        const Eolian_Class *klass = nullptr;
        char* dup = strdup(opts.in_files[0].c_str());
-       char* base = basename(dup);
+       std::string base (basename(dup));
        std::string cpp_types_header;
        opts.unit = (Eolian_Unit*)opts.state;
-       klass = ::eolian_state_class_by_file_get(opts.state, base);
+       klass = ::eolian_state_class_by_file_get(opts.state, base.c_str());
        free(dup);
        if (klass)
          {
@@ -346,8 +346,8 @@ run(options_type const& opts)
                  opts.unit = unit;
              }
            char* dup = strdup(name.c_str());
-           char* base = basename(dup);
-           Eolian_Class const* klass = 
::eolian_state_class_by_file_get(opts.state, base);
+           std::string base(basename(dup));
+           Eolian_Class const* klass = 
::eolian_state_class_by_file_get(opts.state, base.c_str());
            free(dup);
            if (klass)
              {

-- 


Reply via email to