Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 8c52ea4

Browse files
committed
[[ Bug 20510 ]] Fix crash in revDatabaseTableNames
This patch ensures the m_internal_buffer instance var introduced in the MySQL and PostgreSQL drivers to fix the length limit of the revDatabaseTableNames call is initialized to nullptr when the connection is created.
1 parent a985f29 commit 8c52ea4

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

docs/notes/bugfix-20510.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix crash on Windows when using revDatabaseTableNames()

revdb/src/dbmysql.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class DBCursor_MYSQL:public CDBCursor
5252
class DBConnection_MYSQL: public CDBConnection
5353
{
5454
public:
55+
DBConnection_MYSQL(): m_internal_buffer(nullptr) {}
5556
~DBConnection_MYSQL() {disconnect();}
5657
Bool connect(char **args, int numargs);
5758
void disconnect();
@@ -67,10 +68,11 @@ class DBConnection_MYSQL: public CDBConnection
6768
void getTables(char *buffer, int *bufsize);
6869
int getConnectionType(void) { return -1; }
6970
int getVersion(void) { return 2; }
70-
large_buffer_t *m_internal_buffer;
7171
protected:
7272
bool BindVariables(MYSQL_STMT *p_statement, DBString *p_arguments, int p_argument_count, int *p_placeholders, int p_placeholder_count, MYSQL_BIND **p_bind);
7373
bool ExecuteQuery(char *p_query, DBString *p_arguments, int p_argument_count);
7474
MYSQL mysql;
75+
private:
76+
large_buffer_t *m_internal_buffer;
7577
};
7678
#endif

revdb/src/dbpostgresql.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class DBCursor_POSTGRESQL:public CDBCursor
123123
class DBConnection_POSTGRESQL: public CDBConnection
124124
{
125125
public:
126+
DBConnection_POSTGRESQL(): m_internal_buffer(nullptr) {}
126127
~DBConnection_POSTGRESQL() {disconnect();}
127128
Bool connect(char **args, int numargs);
128129
void disconnect();

0 commit comments

Comments
 (0)