Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix segfault when date is NULL. Thanks @alexlbeesappz

  • Loading branch information...
commit 508487a37f71e782f8c836d684d9d9f78c9769f8 1 parent a50f488
@mariano authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/result.cc
View
8 src/result.cc
@@ -217,12 +217,18 @@ char** node_db_oracle::Result::row(unsigned long* rowColumnLengths) throw(node_d
std::string string;
if (this->columns[c]->getType() == Column::DATETIME) {
oracle::occi::Date date = this->resultSet->getDate(c + 1);
- string = date.toText("YYYY-MM-DD HH:II:SS");
+ if (!date.isNull())
+ string = date.toText("YYYY-MM-DD HH:II:SS");
+ }
} else {
string = this->resultSet->getString(c + 1);
}
rowColumnLengths[c] = string.length();
+ if (rowColumnLengths[c] == 0) {
+ row[c] = NULL;
+ continue;
+ }
row[c] = new char[rowColumnLengths[c]];
if (row[c] == NULL) {
Please sign in to comment.
Something went wrong with that request. Please try again.