diff options
author | Alexander von Gluck IV <[email protected]> | 2013-09-24 18:01:21 -0500 |
---|---|---|
committer | Martin Wimpress <[email protected]> | 2014-01-02 11:50:12 +0000 |
commit | a7478138029e077b04bbcf63fb9dbe7ced890b25 (patch) | |
tree | 3a2d125ccb590c2e5775d895b03eade07112403c | |
parent | 97b740eb097cb1111288270f176a737e8bb49cac (diff) | |
download | mate-terminal-a7478138029e077b04bbcf63fb9dbe7ced890b25.tar.bz2 mate-terminal-a7478138029e077b04bbcf63fb9dbe7ced890b25.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.
-rw-r--r-- | src/terminal.c | 3 |
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; } |