raster pushed a commit to branch v-1.26.0.

http://git.enlightenment.org/core/efl.git/commit/?id=76f698faf03be3812cc2220eb26ae5f5758fd1ec

commit 76f698faf03be3812cc2220eb26ae5f5758fd1ec
Author: JunsuChoi <[email protected]>
Date:   Wed Jan 12 11:19:24 2022 +0900

    evas_vg_load_svg: Fix negative attrs length
    
    Summary:
    After finding no attributes but spaces, attrsLength could be negative.
    This will cause a segfault in parser functions.
    So, change the position of attrs_length to prevent this.
    
    Test Plan:
    Example SVG
    ```
    <?xml version="1.0" encoding="UTF-8"?>
    <svg><g  ></g></svg>
    ```
    
    Reviewers: Hermet, raster, kimcinoo
    
    Reviewed By: Hermet
    
    Subscribers: #reviewers, cedric, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D12314
---
 src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c 
b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
index 465b499505..8531aedbd3 100644
--- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
+++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
@@ -2276,12 +2276,12 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader 
*loader,
      {
         // find out the tag name starting from content till sz length
         sz = attrs - content;
-        attrs_length = length - sz;
         while ((sz > 0) && (isspace(content[sz - 1])))
           sz--;
         if ((unsigned int)sz >= sizeof(tag_name)) return;
         strncpy(tag_name, content, sz);
         tag_name[sz] = '\0';
+        attrs_length = length - sz;
      }
 
    if ((method = _find_group_factory(tag_name)))

-- 


Reply via email to