From 008677280d32b6db56483832b143760888c91ad4 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 31 Jul 2012 14:26:53 +0000 Subject: tracker-extract-pdf: Fix crash if mmap() fails Patch from Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=751922 --- 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)); -- cgit v0.9.0.2