Commit cbdafb7c authored by Albrecht Dreß's avatar Albrecht Dreß
Browse files

smtp: fix possible uninitialised memory access



do not access uninitialised memory iff the SMTP server sends a too short
reply
Signed-off-by: Albrecht Dreß's avatarAlbrecht Dreß <albrecht.dress@netcologne.de>
parent 5a39d2a7
Pipeline #301814 passed with stage
in 44 seconds
......@@ -673,7 +673,7 @@ net_client_smtp_read_reply(NetClientSmtp *client, gint expect_code, gchar **last
} else {
/* nothing to do (see MISRA C:2012, Rule 15.7) */
}
if (reply[3] == ' ') {
if ((strlen(reply) > 3UL) && (reply[3] == ' ')) {
done = TRUE;
if (last_reply != NULL) {
*last_reply = g_strdup(&reply[4]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment