[tracker] tracker-extract, msoffice-xml: Avoid possible NULL dereference
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-extract, msoffice-xml: Avoid possible NULL dereference
- Date: Mon, 12 Jul 2010 12:06:51 +0000 (UTC)
commit 41bef6f4ea2e93660d685ea0f9c4081a6a04ef56
Author: Aleksander Morgado <aleksander lanedo com>
Date: Mon Jul 12 14:06:38 2010 +0200
tracker-extract, msoffice-xml: Avoid possible NULL dereference
src/tracker-extract/tracker-extract-msoffice.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-msoffice.c b/src/tracker-extract/tracker-extract-msoffice.c
index a38c76e..aa9d434 100644
--- a/src/tracker-extract/tracker-extract-msoffice.c
+++ b/src/tracker-extract/tracker-extract-msoffice.c
@@ -2110,6 +2110,14 @@ xml_start_element_handler_content_types (GMarkupParseContext *context,
}
}
+ /* Both part_name and content_type MUST be NON-NULL */
+ if (!part_name || !content_type) {
+ g_message ("Invalid file (part_name:%s, content_type:%s)",
+ part_name ? part_name : "none",
+ content_type ? content_type : "none");
+ return;
+ }
+
if ((g_ascii_strcasecmp (content_type, "application/vnd.openxmlformats-package.core-properties+xml") == 0) ||
(g_ascii_strcasecmp (content_type, "application/vnd.openxmlformats-officedocument.extended-properties+xml") == 0)) {
xml_read (info, part_name + 1, MS_OFFICE_XML_TAG_DOCUMENT_CORE_DATA);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]