diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-06-30 11:43:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-06-30 11:43:26 +0200 |
commit | 83c2af51a362a7b90c7a581aaf3763dc18695a37 (patch) | |
tree | e8fa909841040a68565fde5b76fc887aa86b220a | |
parent | db586a28c54a39ddfd2dcefab405320eca374869 (diff) |
Check if truncated pointer is not NULL before dereferencing it
-rw-r--r-- | odb/sqlite/statement.cxx | 6 |
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; |