zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=39f384bba191218ec35240fbf73247bc27eb10d6

commit 39f384bba191218ec35240fbf73247bc27eb10d6
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Oct 18 13:28:54 2019 -0400

    ecore/getopt: handle negative return in arg parsing
    
    Summary:
    _ecore_getopt_parse_find_nonargs_base() can return -1 on errors
    
    CID 1402615
    
    Reviewers: devilhorns
    
    Reviewed By: devilhorns
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D10393
---
 src/lib/ecore/ecore_getopt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lib/ecore/ecore_getopt.c b/src/lib/ecore/ecore_getopt.c
index c85a71a15d..f81df25105 100644
--- a/src/lib/ecore/ecore_getopt.c
+++ b/src/lib/ecore/ecore_getopt.c
@@ -2135,6 +2135,7 @@ ecore_getopt_parse_positional(const Ecore_Getopt *parser,
      start = argc;
    else if (start < 1)
      start = _ecore_getopt_parse_find_nonargs_base(parser, argc, argv);
+   if (start < 0) goto error;
 
    nonargs = start;
    for (desc = parser->descs; !_ecore_getopt_desc_is_sentinel(desc); desc++);

-- 


Reply via email to