aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/statement.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-06-30 11:43:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-06-30 11:43:26 +0200
commit83c2af51a362a7b90c7a581aaf3763dc18695a37 (patch)
treee8fa909841040a68565fde5b76fc887aa86b220a /odb/sqlite/statement.cxx
parentdb586a28c54a39ddfd2dcefab405320eca374869 (diff)
Check if truncated pointer is not NULL before dereferencing it
Diffstat (limited to 'odb/sqlite/statement.cxx')
-rw-r--r--odb/sqlite/statement.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/odb/sqlite/statement.cxx b/odb/sqlite/statement.cxx
index 32e8d2a..0fe52f3 100644
--- a/odb/sqlite/statement.cxx
+++ b/odb/sqlite/statement.cxx
@@ -118,10 +118,10 @@ namespace odb
const bind& b (p[i]);
int j (static_cast<int> (i));
- if (truncated && !*b.truncated)
+ if (truncated && (b.truncated == 0 || !*b.truncated))
continue;
- if (b.truncated)
+ if (b.truncated != 0)
*b.truncated = false;
// Check for NULL unless we are reloading a truncated result.
@@ -155,7 +155,7 @@ namespace odb
if (*b.size > b.capacity)
{
- if (b.truncated)
+ if (b.truncated != 0)
*b.truncated = true;
r = false;