[CONC-518] mthd_my_real_connect() crashes on connection error Created: 2020-11-27  Updated: 2021-06-14  Resolved: 2020-11-27

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.1.9
Fix Version/s: 3.2.0, 3.1.12

Type: Bug Priority: Critical
Reporter: Anton Serbulov Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: crash
Environment:

Microsoft Windows Server 2019 Standard



 Description   

Unhandled exception thrown: read access violation.

The crash happens here:
https://github.com/mariadb-corporation/mariadb-connector-c/blob/v3.1.9/libmariadb/mariadb_lib.c#L1704

error:
  /* Free alloced memory */
  end_server(mysql);
  /* only free the allocated memory, user needs to call mysql_close */
  mysql_close_memory(mysql);
  if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
      !mysql->options.extension->async_context)    <--- mysql->options.extension was nullptr
    mysql_close_options(mysql);
  return(0);

Call stack:

libmariadb!mthd_my_real_connect+0x858 [libmariadb\mariadb_lib.c @ 1703] 
libmariadb!mysql_real_connect+0x24a [libmariadb\mariadb_lib.c @ 1330] 



 Comments   
Comment by Georg Richter [ 2020-11-27 ]

Fixed - rev. 2ff01c121c65a867d80016ba311aa286843565dc

Comment by Anton [ 2020-12-15 ]

Hello @Georg Richter, do you know by any chance when it is planned to issue MariaDB Connector/C 3.1.12 version?

Generated at Thu Feb 08 03:05:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.