From 89a58e23e095c50dc844cbbed577c989cf801e32 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 12 Dec 2013 16:12:04 -0800 Subject: Correctly parse multiple tags in the divelog The old parsing code overwrote the first comma with a '\0' and then checked the index against the length of the buffer - which was changed by replacing the ',' with the '\0'. This means that since commit 78acf20848c0 ("Don't crash on loading tags longer than 127 chars") Subsurface has potentially damaged / lost data in dive files! Added a test dive that shows the issue if opened by a Subsurface version after the commit mentioned above but before this commit. Reported-by: Miika Turkia Signed-off-by: Dirk Hohndel --- dives/test29.xml | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 dives/test29.xml (limited to 'dives') diff --git a/dives/test29.xml b/dives/test29.xml new file mode 100644 index 000000000..9fb40a61d --- /dev/null +++ b/dives/test29.xml @@ -0,0 +1,62 @@ + + + + + + irrelevant dive location + This is a dive that has two tags, boat and wreck + + + + + + + + + + + + + irrelevant dive location + This is a dive that has an empty tags property in the XML file + + + + + + + + + + + + + irrelevant dive location + This is a dive that has a tags property with just a comma in the XML file + + + + + + + + + + + + + irrelevant dive location + This is a dive that has a single letter tag 'a' (plus the boat tag) + + + + + + + + + + + + + -- cgit v1.2.3-70-g09d2