Project

General

Profile

Bug #4734

Wt::Dbo segfaults when calling sql functions

Added by Laszlo Marak almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
02/14/2016
Due date:
% Done:

0%

Estimated time:

Description

I am working on a password authentication module, where the passwordhash and the salt are stored in a mysql database. This very simple code gives me a consistent segfault:

Wt::Dbo::backend::MySQL database
    ( conf.mysql_database
      , conf.mysql_user
      , conf.mysql_password
      , conf.mysql_server_ip
      , conf.mysql_server_port
      , conf.mysql_client_socket.string() );

std::string username("user");
std::string password("12345");

Wt::Dbo::Session session;
session.setConnection(database);

std::string authenticated;
{
  Wt::Dbo::Transaction transaction(session);          
  authenticated = session.template query<std::string>
    ("select sha1(?), salt from User where username = ?")
    .bind(password)
    .bind(username);
}

After tracing the segfault it happens in

Wt/Dbo/backend/MySQL.C:138

in the function

virtual void MySQLStatement::bind(int column, const std::string& value)
#1

Updated by Koen Deforche almost 7 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche
  • Target version set to 3.3.6
#2

Updated by Koen Deforche almost 7 years ago

  • Status changed from InProgress to Feedback

I tested this and it seems to work correctly though (with latest wt git). What version of Wt are you using?

#3

Updated by Koen Deforche almost 7 years ago

  • Status changed from Feedback to InProgress

Actually, I got it failing now.

#4

Updated by Koen Deforche almost 7 years ago

  • Status changed from InProgress to Resolved
#5

Updated by Koen Deforche over 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF