mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
MNDR:
- move from char* + len to MYSQLND_STRING - add some more const modifiers
This commit is contained in:
parent
a530ecff97
commit
c286d7075d
7 changed files with 82 additions and 83 deletions
|
@ -271,18 +271,18 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
|
|||
}
|
||||
if (ret == PASS) {
|
||||
char * tmp = NULL;
|
||||
/* if we get conn->user as parameter and then we first free it, then estrndup it, we will crash */
|
||||
/* if we get conn->username as parameter and then we first free it, then estrndup it, we will crash */
|
||||
tmp = mnd_pestrndup(user, user_len, conn->persistent);
|
||||
if (conn->user) {
|
||||
mnd_pefree(conn->user, conn->persistent);
|
||||
if (conn->username.s) {
|
||||
mnd_pefree(conn->username.s, conn->persistent);
|
||||
}
|
||||
conn->user = tmp;
|
||||
conn->username.s = tmp;
|
||||
|
||||
tmp = mnd_pestrdup(passwd, conn->persistent);
|
||||
if (conn->passwd) {
|
||||
mnd_pefree(conn->passwd, conn->persistent);
|
||||
if (conn->password.s) {
|
||||
mnd_pefree(conn->password.s, conn->persistent);
|
||||
}
|
||||
conn->passwd = tmp;
|
||||
conn->password.s = tmp;
|
||||
|
||||
if (conn->last_message.s) {
|
||||
mnd_pefree(conn->last_message.s, conn->persistent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue