[tracker] tracker-extract-pdf: Fix crash if mmap() fails
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-extract-pdf: Fix crash if mmap() fails
- Date: Tue, 31 Jul 2012 13:29:30 +0000 (UTC)
commit 008677280d32b6db56483832b143760888c91ad4
Author: Sam Thursfield <sam thursfield codethink co uk>
Date: Tue Jul 31 15:26:53 2012 +0100
tracker-extract-pdf: Fix crash if mmap() fails
Patch from Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=751922
src/tracker-extract/tracker-extract-pdf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-pdf.c b/src/tracker-extract/tracker-extract-pdf.c
index caa24c7..85066b3 100644
--- a/src/tracker-extract/tracker-extract-pdf.c
+++ b/src/tracker-extract/tracker-extract-pdf.c
@@ -451,7 +451,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
len = 0;
} else {
contents = (gchar *) mmap (NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
- if (contents == NULL) {
+ if (contents == NULL || contents == MAP_FAILED) {
g_warning ("Could not mmap pdf file '%s': %s\n",
filename,
g_strerror (errno));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]