Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Escape without a connection no longer throws a segmentation fault

  • Loading branch information...
commit f1275ab0bcfb9f08853ec240dc4b6afc03de5624 1 parent e42d003
@mariano authored
Showing with 5 additions and 1 deletion.
  1. +1 −1  lib/node-db
  2. +4 −0 src/connection.cc
2  lib/node-db
@@ -1 +1 @@
-Subproject commit a389ed4ff932bc9f9565d00bd85f855ce873a228
+Subproject commit 806d7b47fe036bdafb4eb3770ed3aea9abaa972b
View
4 src/connection.cc
@@ -125,6 +125,10 @@ void node_db_mysql::Connection::close() {
}
std::string node_db_mysql::Connection::escape(const std::string& string) const throw(node_db::Exception&) {
+ if (!this->alive) {
+ throw node_db::Exception("Can\'t escape string without an active connection");
+ }
+
char* buffer = new char[string.length() * 2 + 1];
if (buffer == NULL) {
throw node_db::Exception("Can\'t create buffer to escape string");
Please sign in to comment.
Something went wrong with that request. Please try again.