summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander von Gluck IV <[email protected]>2013-09-24 18:01:21 -0500
committerAlexander von Gluck IV <[email protected]>2013-09-24 18:01:21 -0500
commit707c3b56c0c68f12ca70dd6adadf27c6d1959021 (patch)
tree1cc0f6f70cd1ec39628335d14fb21d19f9b804eb /src
parent693f9ae54e74d7bccbcbdcf66fb146b1666c896d (diff)
downloadmate-terminal-707c3b56c0c68f12ca70dd6adadf27c6d1959021.tar.bz2
mate-terminal-707c3b56c0c68f12ca70dd6adadf27c6d1959021.tar.xz
ay_to_strv: Prevent dereferencing a NULL pointer.
* clang static analysis shows that ay_to_strv is called with argc set to NULL. This can cause ay_to_strv to dereference the pointer in a failure situation.
Diffstat (limited to 'src')
-rw-r--r--src/terminal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 7434229..82af964 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -82,7 +82,8 @@ ay_to_strv (GVariant *variant,
data = g_variant_get_fixed_array (variant, &data_len, sizeof (char));
if (data_len == 0 || data_len > G_MAXSSIZE)
{
- *argc = 0;
+ if (argc != NULL)
+ *argc = 0;
return NULL;
}