An SMTP Client writen in C++ for Qt. Allows applications to send emails (MIME with text, html, attachments, inline files, etc.) via SMTP. Supports SSL and SMTP authentication.
void SmtpClient::socketReadyRead()
{
QString responseLine;
if (!socket->isOpen()) {
emitError(SocketError);
return;
}
while (socket->canReadLine()) {
// Save the server's response
responseLine = socket->readLine();
tempResponse += responseLine;
#ifndef QT_NO_DEBUG
qDebug() << "[Socket] IN: " << responseLine;
#endif
}
// Is this the last line of the response
if (responseLine[3] == ' ') { // BUG: potential index out of range if responseLine.length() < 4
responseText = tempResponse;
tempResponse = "";
Hi,
just noted something in
smtpclient.cpp
:A length check is missing.