Hi,
Ihandle* ih_names[MAX_NAMES] = {NULL};
Has the same effect that call function memset and is more fast.

Accessing pointer var uninitialized are ever insecure and bug prone.
Best.
Ranier.
________________________________________
De: Antonio Scuri <antonio.sc...@gmail.com>
Enviado: quarta-feira, 17 de janeiro de 2018 00:39
Para: IUP discussion list.
Assunto: Re: [Iup-users] CID 210635 (#1 of 1): Uninitialized scalar variable 
(UNINIT)

  This is the same case as the previous e-mail. The logic access the array only 
at the current count, which starts at 0. I don't think there is a problem 
there, but the memset of the previous e-mail was harmless. So I repeat it for 
coehrence.

  memset(ih_names, 0, MAX_NAMES * sizeof(Ihandle*));

 Fixed and committed to SVN.

Best,
Scuri


2018-01-16 22:31 GMT-02:00 Ranier VF 
<ranier_...@hotmail.com<mailto:ranier_...@hotmail.com>>:
Hi,
Issue found by Coverity Scan.
CID 210635 (#1 of 1): Uninitialized scalar variable (UNINIT)

--- a\srcview\iup_view.c        Fri Sep 29 14:05:12 2017
+++ b\srcview\iup_view.c        Tue Jan 16 22:29:20 2018
@@ -656,7 +656,7 @@
 {
   char *names[MAX_NAMES];
   Ihandle* ih;
-  Ihandle* ih_names[MAX_NAMES];
+  Ihandle* ih_names[MAX_NAMES] = {NULL};
   Ihandle* list = (Ihandle*)IupGetAttribute(self, "mainList");
   int i, j=0, num_names = IupGetAllNames(names, MAX_NAMES);
   for (i = 0; i < num_names; i++)

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<mailto: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