[tracker/rss-enclosures] Fixes GB#627281: Crash in msoffice extractor
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] Fixes GB#627281: Crash in msoffice extractor
- Date: Wed, 24 Nov 2010 01:24:43 +0000 (UTC)
commit ac7744087c406fe439661a150c635450d7b4ee85
Author: Aleksander Morgado <aleksander lanedo com>
Date: Thu Aug 19 17:43:10 2010 +0200
Fixes GB#627281: Crash in msoffice extractor
* Length of PRC structure was wrongly read when greater than 256 bytes.
src/tracker-extract/tracker-extract-msoffice.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-msoffice.c b/src/tracker-extract/tracker-extract-msoffice.c
index 099c7aa..2360c0f 100644
--- a/src/tracker-extract/tracker-extract-msoffice.c
+++ b/src/tracker-extract/tracker-extract-msoffice.c
@@ -866,12 +866,21 @@ extract_msword_content (GsfInfile *infile,
while (TRUE) {
if (clx[i] == 2) {
+ /* Nice, a proper structure with contents, no need to
+ * iterate more. */
lcb_piece_table = read_32bit (clx + (i + 1));
piece_table = clx + i + 5;
piece_count = (lcb_piece_table - 4) / 12;
break;
} else if (clx[i] == 1) {
- i = i + 2 + clx[i + 1];
+ /* Oh, a PRC structure with properties of text, not
+ * real text, so skip it */
+ guint16 GrpPrl_len;
+
+
+ GrpPrl_len = read_16bit (&clx[i+1]);
+ /* 3 is the length of clxt (1byte) and cbGrpprl(2bytes) */
+ i = i + 3 + GrpPrl_len;
} else {
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]