[geany/geany] bd9d26: Fix crash in lookup_includes()
Jiří Techet
git-noreply at xxxxx
Fri Jun 10 21:57:33 UTC 2016
Branch: refs/heads/master
Author: Jiří Techet <techet at gmail.com>
Committer: Jiří Techet <techet at gmail.com>
Date: Fri, 06 May 2016 19:42:13 UTC
Commit: bd9d26a0d121f9bcabd2fcce26fb5c77b7bfa81a
https://github.com/geany/geany/commit/bd9d26a0d121f9bcabd2fcce26fb5c77b7bfa81a
Log Message:
-----------
Fix crash in lookup_includes()
Right now
geany -g foo.c.tags \"
makes Geany crash.
Modified Paths:
--------------
tagmanager/src/tm_workspace.c
Modified: tagmanager/src/tm_workspace.c
7 lines changed, 6 insertions(+), 1 deletions(-)
===================================================================
@@ -490,7 +490,12 @@ static GList *lookup_includes(const gchar **includes, gint includes_count)
for (i = 0; i < includes_count; i++)
{
size_t dirty_len = strlen(includes[i]);
- gchar *clean_path = g_malloc(dirty_len - 1);
+ gchar *clean_path;
+
+ if (dirty_len < 2)
+ continue;
+
+ clean_path = g_malloc(dirty_len - 1);
strncpy(clean_path, includes[i] + 1, dirty_len - 1);
clean_path[dirty_len - 2] = 0;
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list