[tracker] tracker-extract: Fix possible invalid memory read/write
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-extract: Fix possible invalid memory read/write
- Date: Sun, 7 Dec 2014 22:14:21 +0000 (UTC)
commit ee7b08f0c4853a2a88488c0accccb6413302876e
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Nov 30 12:39:06 2014 +0100
tracker-extract: Fix possible invalid memory read/write
If length is 0, out of bounds data would be read, and then written.
src/libtracker-extract/tracker-utils.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-utils.c b/src/libtracker-extract/tracker-utils.c
index 92a0549..308fb5d 100644
--- a/src/libtracker-extract/tracker-utils.c
+++ b/src/libtracker-extract/tracker-utils.c
@@ -936,7 +936,7 @@ tracker_keywords_parse (GPtrArray *store,
}
len = strlen (keywords_d);
- if (keywords_d[len - 1] == '"') {
+ if (len > 0 && keywords_d[len - 1] == '"') {
keywords_d[len - 1] = '\0';
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]