Hi,
Issue found by Coverity Scan.
CID 259207 (#1 of 1): Dereference null return value (NULL_RETURNS)
4. dereference: Dereferencing a null pointer ih.

--- a\src\win\iupwin_tabs.c     Mon Dec 11 14:52:42 2017
+++ b\src\win\iupwin_tabs.c     Wed Jan 24 23:11:36 2018
@@ -436,11 +436,15 @@
   {
   case WM_ERASEBKGND:
     {
-      RECT rect;
-      HDC hDC = (HDC)wp;
       Ihandle* ih = iupwinHandleGet(hWnd);
-      GetClientRect(ih->handle, &rect); 
-      winTabsDrawPageBackground(ih, hDC, &rect);
+      if (ih)
+      {
+         RECT rect;
+         HDC hDC = (HDC)wp;
+
+         GetClientRect(ih->handle, &rect); 
+         winTabsDrawPageBackground(ih, hDC, &rect);
+      }
 
       /* return non zero value */
       return 1;

Best,
Ranier Vilela

Attachment: iupwin_tabs.patch
Description: iupwin_tabs.patch

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