From ebe4c7f86c9a531be5cd4291c24c926fac49e29d Mon Sep 17 00:00:00 2001 From: EdwinGH <36776350+EdwinGH@users.noreply.github.com> Date: Fri, 19 May 2023 11:26:04 +0200 Subject: [PATCH 1/6] Update MySQL_Connection.cpp Modified input char* variables to be const --- src/MySQL_Connection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MySQL_Connection.cpp b/src/MySQL_Connection.cpp index 7cbf83a..d50312b 100644 --- a/src/MySQL_Connection.cpp +++ b/src/MySQL_Connection.cpp @@ -58,8 +58,8 @@ const char DISCONNECTED[] PROGMEM = "Disconnected."; Returns boolean - True = connection succeeded */ -boolean MySQL_Connection::connect(IPAddress server, int port, char *user, - char *password, char *db) +boolean MySQL_Connection::connect(IPAddress server, int port, const char *user, + const char *password, const char *db) { int connected = 0; int retries = MAX_CONNECT_ATTEMPTS; From 8f4dfc796aa0c2ad6638d7246118158e9c41c78c Mon Sep 17 00:00:00 2001 From: EdwinGH <36776350+EdwinGH@users.noreply.github.com> Date: Fri, 19 May 2023 11:35:59 +0200 Subject: [PATCH 2/6] Update MySQL_Connection.h Modified input char* variables to const --- src/MySQL_Connection.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MySQL_Connection.h b/src/MySQL_Connection.h index 6537b99..1816996 100644 --- a/src/MySQL_Connection.h +++ b/src/MySQL_Connection.h @@ -42,8 +42,8 @@ class MySQL_Connection : public MySQL_Packet { public: MySQL_Connection(Client *client_instance) : MySQL_Packet(client_instance) {} - boolean connect(IPAddress server, int port, char *user, char *password, - char *db=NULL); + boolean connect(IPAddress server, int port, const char *user, const char *password, + const char *db=NULL); int connected() { return client->connected(); } const char *version() { return MYSQL_VERSION_STR; } void close(); From bf934884cdd33326753520bd9f94ae232b4c3a1c Mon Sep 17 00:00:00 2001 From: EdwinGH <36776350+EdwinGH@users.noreply.github.com> Date: Fri, 19 May 2023 12:09:12 +0200 Subject: [PATCH 3/6] Update MySQL_Packet.cpp Modified char* input variables to const --- src/MySQL_Packet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MySQL_Packet.cpp b/src/MySQL_Packet.cpp index b9c0cf7..0d18f07 100644 --- a/src/MySQL_Packet.cpp +++ b/src/MySQL_Packet.cpp @@ -94,8 +94,8 @@ void MySQL_Packet::show_error(const char *msg, bool EOL) { password[in] password db[in] default database */ -void MySQL_Packet::send_authentication_packet(char *user, char *password, - char *db) +void MySQL_Packet::send_authentication_packet(const char *user, const char *password, + const char *db) { if (buffer != NULL) free(buffer); From e973d4677ddac4ea3eb0947c18b9f978172ecb27 Mon Sep 17 00:00:00 2001 From: EdwinGH <36776350+EdwinGH@users.noreply.github.com> Date: Fri, 19 May 2023 12:09:53 +0200 Subject: [PATCH 4/6] Update MySQL_Packet.h --- src/MySQL_Packet.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MySQL_Packet.h b/src/MySQL_Packet.h index 20399f1..1337e0b 100644 --- a/src/MySQL_Packet.h +++ b/src/MySQL_Packet.h @@ -63,8 +63,8 @@ class MySQL_Packet { MySQL_Packet(Client *client_instance); boolean complete_handshake(char *user, char *password); - void send_authentication_packet(char *user, char *password, - char *db=NULL); + void send_authentication_packet(const char *user, const char *password, + const char *db=NULL); void parse_handshake_packet(); boolean scramble_password(char *password, byte *pwd_hash); void read_packet(); From 1448b22c5e12fa245e73632fb5e2a7014b9bf11a Mon Sep 17 00:00:00 2001 From: EdwinGH <36776350+EdwinGH@users.noreply.github.com> Date: Fri, 19 May 2023 12:17:38 +0200 Subject: [PATCH 5/6] Update MySQL_Packet.cpp --- src/MySQL_Packet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MySQL_Packet.cpp b/src/MySQL_Packet.cpp index 0d18f07..0820f3d 100644 --- a/src/MySQL_Packet.cpp +++ b/src/MySQL_Packet.cpp @@ -175,7 +175,7 @@ void MySQL_Packet::send_authentication_packet(const char *user, const char *pass Returns boolean - True = scramble succeeded */ -boolean MySQL_Packet::scramble_password(char *password, byte *pwd_hash) { +boolean MySQL_Packet::scramble_password(const char *password, byte *pwd_hash) { byte *digest; byte hash1[20]; byte hash2[20]; From 1dc1d4787bb2ea48652a534046769bff6a3095d1 Mon Sep 17 00:00:00 2001 From: EdwinGH <36776350+EdwinGH@users.noreply.github.com> Date: Fri, 19 May 2023 12:18:08 +0200 Subject: [PATCH 6/6] Update MySQL_Packet.h --- src/MySQL_Packet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MySQL_Packet.h b/src/MySQL_Packet.h index 1337e0b..135aa80 100644 --- a/src/MySQL_Packet.h +++ b/src/MySQL_Packet.h @@ -66,7 +66,7 @@ class MySQL_Packet { void send_authentication_packet(const char *user, const char *password, const char *db=NULL); void parse_handshake_packet(); - boolean scramble_password(char *password, byte *pwd_hash); + boolean scramble_password(const char *password, byte *pwd_hash); void read_packet(); int get_packet_type(); void parse_error_packet();