Project

General

Profile

Actions

Bug #4734

closed

Wt::Dbo segfaults when calling sql functions

Added by Laszlo Marak about 8 years ago. Updated almost 8 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)
Actions #1

Updated by Koen Deforche about 8 years ago

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

Updated by Koen Deforche about 8 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?

Actions #3

Updated by Koen Deforche about 8 years ago

  • Status changed from Feedback to InProgress

Actually, I got it failing now.

Actions #4

Updated by Koen Deforche about 8 years ago

  • Status changed from InProgress to Resolved
Actions #5

Updated by Koen Deforche almost 8 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF