[libgdamm] SqlBuilder::select_add_target(): Avoid "stack smashing detected".

commit 7625f82b44a9fe9ce8c91f623c993761abc2c772
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Oct 27 22:11:40 2015 +0100

    SqlBuilder::select_add_target(): Avoid "stack smashing detected".
    Passing the std::string::c_str(), instead of the std::string, seemed
    to result in a temporary object whose lifetime was limited.

 libgda/src/sqlbuilder.ccg |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libgda/src/sqlbuilder.ccg b/libgda/src/sqlbuilder.ccg
index 02e26b2..cdfdb9c 100644
--- a/libgda/src/sqlbuilder.ccg
+++ b/libgda/src/sqlbuilder.ccg
@@ -91,7 +91,7 @@ SqlBuilder::Id SqlBuilder::add_function(const Glib::ustring& function_name, Id a
 SqlBuilder::Id SqlBuilder::select_add_target(const Glib::ustring& table_name, const Glib::ustring& alias)
-  return gda_sql_builder_select_add_target(gobj(), table_name.c_str(), string_or_null(alias.c_str()));
+  return gda_sql_builder_select_add_target(gobj(), table_name.c_str(), string_or_null(alias));
 SqlBuilder::Id SqlBuilder::select_join_targets(Id left_target_id, Id right_target_id, SqlSelectJoinType 
join_type, Id join_expr)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]