1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 12:58:08 +01:00

wmaker: fix incomplete null pointer check in wFrameWindowChangeTitle (Coverity #50058)

As pointed by Coverity, despite the numerous null pointer checks there is
still a case where one can pass trough and make wmaker crash.

This patch simplifies it all but making only one check at the beginning so
the code is safe and the remaining is simpler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
Christophe CURIS
2014-11-15 19:40:47 +01:00
committed by Carlos R. Mafra
parent e27bab9f36
commit 38463df102

View File

@@ -1205,12 +1205,12 @@ void wFrameWindowResize(WFrameWindow * fwin, int width, int height)
int wFrameWindowChangeTitle(WFrameWindow *fwin, const char *new_title)
{
if (new_title == NULL)
return 0;
/* check if the title is the same as before */
if (fwin->title) {
if (new_title && (strcmp(fwin->title, new_title) == 0))
return 0;
} else {
if (!new_title)
if (strcmp(fwin->title, new_title) == 0)
return 0;
}