[totem-pl-parser] plparse: Fix invalid check of non-dereferenced pointer against NULL
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem-pl-parser] plparse: Fix invalid check of non-dereferenced pointer against NULL
- Date: Mon, 19 May 2014 11:27:51 +0000 (UTC)
commit 6052b330efe172d506913e50e9a9e2309830e830
Author: Philip Withnall <philip withnall collabora co uk>
Date: Mon May 19 11:09:57 2014 +0100
plparse: Fix invalid check of non-dereferenced pointer against NULL
g_strsplit() guarantees to return a non-empty array. line is set to
lines+1, so can never be equal to 0 (i.e. NULL). It needs to be
dereferenced first to check for the array delimiter.
Coverity issue: #60477
https://bugzilla.gnome.org/show_bug.cgi?id=730365
plparse/totem-pl-parser-qt.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plparse/totem-pl-parser-qt.c b/plparse/totem-pl-parser-qt.c
index 335b4cb..03ff9da 100644
--- a/plparse/totem-pl-parser-qt.c
+++ b/plparse/totem-pl-parser-qt.c
@@ -91,8 +91,8 @@ totem_pl_parser_add_quicktime_rtsptext (TotemPlParser *parser,
char **line;
g_free (rtspuri);
- for (line = lines + 1; line && *line[0] == '\0'; line++);
- if (line == NULL)
+ for (line = lines + 1; *line && *line[0] == '\0'; line++);
+ if (*line == NULL)
return TOTEM_PL_PARSER_RESULT_ERROR;
rtspuri = g_strdup (*line);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]