Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Fri, 06 May 2016 19:42:13 UTC Commit: bd9d26a0d121f9bcabd2fcce26fb5c77b7bfa81a https://github.com/geany/geany/commit/bd9d26a0d121f9bcabd2fcce26fb5c77b7bfa8...
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).