grim/libgnt
Clone
Summary
Browse
Changes
Graph
Fix some CWE-476 coverity warnings
release-2.x.y
2014-05-06, Tomasz Wasilczyk
d2943ae9fe18
Parents
8798257b5e37
Children
2fd58955e886
Fix some CWE-476 coverity warnings
2 files changed, 8 insertions(+), 0 deletions(-)
+6
-0
gnttextview.c
+2
-0
gntws.c
--- a/gnttextview.c Tue May 06 19:38:50 2014 +0200
+++ b/gnttextview.c Tue May 06 20:07:13 2014 +0200
@@ -758,6 +758,12 @@
GList *segs, *snext;
GntTextLine *line = iter->data;
inext = iter->next;
+
+ if (!line) {
+ g_warn_if_reached();
+ continue;
+ }
+
for (segs = line->segments; segs; segs = snext) {
GntTextSegment *seg = segs->data;
snext = segs->next;
--- a/gntws.c Tue May 06 19:38:50 2014 +0200
+++ b/gntws.c Tue May 06 20:07:13 2014 +0200
@@ -62,6 +62,8 @@
if (gnt_is_refugee())
return;
+ g_return_if_fail(ws != NULL);
+
if (taskbar == NULL) {
taskbar = newwin(1, getmaxx(stdscr), getmaxy(stdscr) - 1, 0);
} else if (reposition) {