summaryrefslogtreecommitdiffstats
path: root/src/file_txt.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2018-02-07 18:51:39 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2018-02-07 18:51:39 +0100
commit1de381c175aef90dd83e56108979094f9552b540 (patch)
tree144fca7c8d4de6c6e98e117c0920eb5bdb9fb4bc /src/file_txt.c
parent01127583190563b1151c1d81b3f7a263bd57a6ad (diff)
PhotoRec: better .gpx end detection
Diffstat (limited to 'src/file_txt.c')
-rw-r--r--src/file_txt.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/file_txt.c b/src/file_txt.c
index 4152046..59638a5 100644
--- a/src/file_txt.c
+++ b/src/file_txt.c
@@ -734,6 +734,12 @@ static int header_check_vbm(const unsigned char *buffer, const unsigned int buff
return 1;
}
+static void file_check_gpx(file_recovery_t *file_recovery)
+{
+ file_search_footer(file_recovery, "</gpx>", 6, 0);
+ file_allow_nl(file_recovery, NL_BARENL|NL_CRLF|NL_BARECR);
+}
+
static void file_check_xml(file_recovery_t *file_recovery)
{
file_search_footer(file_recovery, ">", 1, 0);
@@ -830,6 +836,9 @@ static int header_check_xml(const unsigned char *buffer, const unsigned int buff
{
/* GPS eXchange Format */
file_recovery_new->extension="gpx";
+ file_recovery_new->file_check=&file_check_gpx;
+ free(buf);
+ return 1;
}
else if(strncasecmp(tmp, "<PremiereData Version=", 22)==0)
{