[xneur] - Add Patch0: xneur-0.17.0-memory-misusages-fix.patch (bz#1175114) made by Alexey Radkov and sent up
Pavel Alexeev
hubbitus at fedoraproject.org
Thu Jan 15 18:55:29 UTC 2015
commit b718c1d7fe502c7413103554364489579b3db0c1
Author: Hubbitus <pahan at hubbitus.info>
Date: Thu Jan 15 21:55:25 2015 +0300
- Add Patch0: xneur-0.17.0-memory-misusages-fix.patch (bz#1175114) made by Alexey Radkov and sent upstream.
xneur-0.17.0-memory-misusages-fix.patch | 80 +++++++++++++++++++++++++++++++
1 files changed, 80 insertions(+), 0 deletions(-)
---
diff --git a/xneur-0.17.0-memory-misusages-fix.patch b/xneur-0.17.0-memory-misusages-fix.patch
new file mode 100644
index 0000000..394255d
--- /dev/null
+++ b/xneur-0.17.0-memory-misusages-fix.patch
@@ -0,0 +1,80 @@
+--- a/xneur/lib/ai/detection.c Thu Nov 20 15:40:07 2014 +0300
++++ a/xneur/lib/ai/detection.c Fri Dec 12 16:44:50 2014 +0300
+@@ -273,7 +273,10 @@
+ if (handle->languages[lang].disable_auto_detection || handle->languages[lang].excluded)
+ {
+ if (possible_words != NULL)
++ {
+ free (possible_words);
++ possible_words = NULL;
++ }
+ if (word != NULL)
+ free(word);
+ continue;
+@@ -284,7 +287,10 @@
+ if ((word_len > 250) || (word_len < 2))
+ {
+ if (possible_words != NULL)
++ {
+ free (possible_words);
++ possible_words = NULL;
++ }
+ if (word != NULL)
+ free(word);
+ continue;
+@@ -305,7 +311,10 @@
+ if (!handle->has_enchant_checker[lang])
+ {
+ if (possible_words != NULL)
++ {
+ free (possible_words);
++ possible_words = NULL;
++ }
+ if (word != NULL)
+ free(word);
+ continue;
+@@ -336,7 +345,10 @@
+ if (!handle->has_spell_checker[lang])
+ {
+ if (possible_words != NULL)
++ {
+ free (possible_words);
++ possible_words = NULL;
++ }
+ if (word != NULL)
+ free(word);
+ continue;
+@@ -345,7 +357,10 @@
+ if (! suggestions)
+ {
+ if (possible_words != NULL)
++ {
+ free (possible_words);
++ possible_words = NULL;
++ }
+ if (word != NULL)
+ free(word);
+ continue;
+--- a/xneur/lib/main/program.c Thu Nov 20 15:40:07 2014 +0300
++++ a/xneur/lib/main/program.c Fri Dec 12 16:44:50 2014 +0300
+@@ -1414,7 +1414,8 @@
+ if (!word)
+ return FALSE;
+
+- if ((p->buffer->content[p->buffer->cur_pos-1] == ' ') ||
++ if ((p->buffer->cur_pos <= 0) ||
++ (p->buffer->content[p->buffer->cur_pos-1] == ' ') ||
+ (p->buffer->content[p->buffer->cur_pos-1] == 0) || // Nothing word
+ (p->buffer->content[p->buffer->cur_pos-1] == 13) || // Enter
+ (p->buffer->content[p->buffer->cur_pos-1] == 11)) // Tab
+--- a/xneur/lib/notify/sound.c Thu Nov 20 15:40:07 2014 +0300
++++ a/xneur/lib/notify/sound.c Fri Dec 12 16:44:50 2014 +0300
+@@ -302,7 +302,7 @@
+
+ static const char *program_name = "aplay";
+
+- char *command = malloc((strlen(path) + strlen(program_name) + 1) * sizeof(char));
++ char *command = malloc((strlen(path) + strlen(program_name) + 2) * sizeof(char));
+ sprintf(command, "%s %s", program_name, path);
+ if (system(command) == -1)
+ log_message(ERROR, _("Can't execute command '%s'"), command);
More information about the scm-commits
mailing list