Notice that the if is actually an assertion:

   if (!iupObjectCheck(ih))
    return -1;

  If that fail, it means the IupFlatTabs handle is not valid anymore. And
that can not occur at that point.

Best,
Scuri


2018-01-19 0:14 GMT-02:00 Ranier VF <ranier_...@hotmail.com>:

> Hi,
> Issue found by Coverity Scan.
> CID 210629 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
> return_negative_constant: Explicitly returning negative value -1.
>
> iup_childtree.c, function IupGetChildCount:
>
> --- a\src\iup_childtree.c       Tue May 02 23:06:40 2017
> +++ b\src\iup_childtree.c       Fri Jan 19 00:10:02 2018
> @@ -440,7 +440,7 @@
>
>    iupASSERT(iupObjectCheck(ih));
>    if (!iupObjectCheck(ih))
> -    return -1;
> +    return 0;
>
>    for (child = ih->firstchild; child; child = child->brother)
>      count++;
>
> This fixes iFlatTabsCheckVisibleTab function in iup_flattabs.c
> at line 159, where call function calloc:
> CID 210629 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
> negative_returns: count is passed to a parameter that cannot be negative.
> visible_width = calloc(count, sizeof(int));
>
> Best.
> Ranier
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to