[tracker/parser-unicode-libs-review] Avoid invalid write out of buffer



commit b0c7079bb2c08cb837f94cacb82f2174f9b06ecb
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Wed May 5 13:02:29 2010 +0200

    Avoid invalid write out of buffer

 src/libtracker-fts/tracker-parser-libunistring.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-fts/tracker-parser-libunistring.c b/src/libtracker-fts/tracker-parser-libunistring.c
index f022cbb..eb308b3 100644
--- a/src/libtracker-fts/tracker-parser-libunistring.c
+++ b/src/libtracker-fts/tracker-parser-libunistring.c
@@ -392,7 +392,7 @@ process_word_utf8 (TrackerParser         *parser,
 		/* For ASCII-only, just tolower() each character */
 		gsize i;
 
-		normalized = length > WORD_BUFFER_LENGTH ? g_malloc (length) : word_buffer;
+		normalized = length > WORD_BUFFER_LENGTH ? g_malloc (length + 1) : word_buffer;
 
 		for (i = 0; i < length; i++) {
 			normalized[i] = g_ascii_tolower (word[i]);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]