summaryrefslogtreecommitdiff
path: root/databases/palm-db-tools/patches/patch-ae
diff options
context:
space:
mode:
Diffstat (limited to 'databases/palm-db-tools/patches/patch-ae')
-rw-r--r--databases/palm-db-tools/patches/patch-ae16
1 files changed, 16 insertions, 0 deletions
diff --git a/databases/palm-db-tools/patches/patch-ae b/databases/palm-db-tools/patches/patch-ae
new file mode 100644
index 00000000000..64bf8768166
--- /dev/null
+++ b/databases/palm-db-tools/patches/patch-ae
@@ -0,0 +1,16 @@
+$NetBSD: patch-ae,v 1.1 2007/10/21 03:53:45 dsainty Exp $
+
+Correctly terminate default string values on NUL.
+
+--- libflatfile/DB.cpp.orig 2003-06-20 11:37:46.000000000 +1200
++++ libflatfile/DB.cpp 2007-10-12 17:57:05.000000000 +1300
+@@ -275,7 +276,8 @@
+ switch (type) {
+
+ case PalmLib::FlatFile::Field::STRING:
+- theReturn << std::string((const char *)chunk.data()+2, chunk.size() - 2);
++ // c_str: The default value is (or at least may be) NUL terminated.
++ theReturn << std::string((const char *)chunk.data()+2, chunk.size() - 2).c_str();
+ break;
+
+ case PalmLib::FlatFile::Field::BOOLEAN: