WINGs: fix possible NULL pointer dereference (Coverity #50197)
commit7a39f3281696093b92735dc40d734ff25d390be4
authorChristophe CURIS <christophe.curis@free.fr>
Sun, 18 May 2014 19:31:51 +0000 (18 21:31 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 18 May 2014 22:01:43 +0000 (18 23:01 +0100)
treed4723c9921302085966e8db14ce18cc8b50cc6e4
parent28ce91a9011ee1559ef5f7b09f0b23ee8e25fd12
WINGs: fix possible NULL pointer dereference (Coverity #50197)

As pointed by Coverity, the 'paintItem' function in the WMBrowser widget
is checking for nullity of its text argument, but before that it called the
strlen function which crashes on NULL pointer. This patch moves the strlen
call to the right place and reduce the lifespan of 'textLen' to highlight
incorrect tries to use the variable.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WINGs/wbrowser.c