1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-09 22:24:09 +03:00

MDEV-8673 - [PATCH] Missing Sanity Check for strndup() in MariaDB 10.0.2x

Contributed by Bill Parker.

Added check for strndup() return value.
This commit is contained in:
Sergey Vojtovich
2015-09-16 17:24:34 +04:00
parent 173e486950
commit c69cf93bfb

View File

@@ -98,7 +98,8 @@ static int conv(int n, const struct pam_message **msg,
if (pkt_len < 0)
return PAM_CONV_ERR;
/* allocate and copy the reply to the response array */
(*resp)[i].resp = strndup((char*)pkt, pkt_len);
if (!((*resp)[i].resp= strndup((char*) pkt, pkt_len)))
return PAM_CONV_ERR;
param->ptr = param->buf + 1;
}
}