Fixed lint messages related to bug 2409.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit dde77f0a9a)
r14.0.x
Michele Calgaro 6 years ago committed by Slávek Banko
parent af2dd0f1ed
commit 990c682731
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -400,7 +400,7 @@ bool FtpDirectoryParser::parseMlsd(const TQString &line, DirectoryEntry &entry)
return true; return true;
} }
bool FtpDirectoryParser::parseUnixPermissions(const TQString &permissions, DirectoryEntry &entry) void FtpDirectoryParser::parseUnixPermissions(const TQString &permissions, DirectoryEntry &entry)
{ {
int p = 0; int p = 0;

@ -84,7 +84,7 @@ private:
bool parseComplexFileSize(DToken &token, filesize_t &size); bool parseComplexFileSize(DToken &token, filesize_t &size);
bool parseUnixPermissions(const TQString &permissions, DirectoryEntry &entry); void parseUnixPermissions(const TQString &permissions, DirectoryEntry &entry);
}; };
} }

@ -61,27 +61,27 @@ void DESEncryptor::DESExec(const TQString &str, int mode)
memcpy(in.data(), string.data(), in.size()); memcpy(in.data(), string.data(), in.size());
} }
// Read 8 chars at a time and encrypt/decrypt them // Read sizeof(DES_cblock) chars at a time and encrypt/decrypt them
unsigned int i = 0; unsigned int i = 0;
char *o_message = (char*) malloc(8); DES_cblock *o_message = (DES_cblock*) malloc(sizeof(DES_cblock));
char *o_output = (char*) malloc(8); DES_cblock *o_output = (DES_cblock*) malloc(sizeof(DES_cblock));
memset(o_message, 0, 9); memset(o_message, 0, sizeof(DES_cblock));
memset(o_output, 0, 9); memset(o_output, 0, sizeof(DES_cblock));
//out.resize(in.size() * 2); //out.resize(in.size() * 2);
while (i < in.size()) { while (i < in.size()) {
out.resize(out.size() + 8); out.resize(out.size() + sizeof(DES_cblock));
memcpy(o_message, in.data() + i, 8); memcpy(o_message, in.data() + i, sizeof(DES_cblock));
DES_ecb_encrypt((DES_cblock *) o_message, (DES_cblock*) o_output, &m_schedule, mode); DES_ecb_encrypt(o_message, o_output, &m_schedule, mode);
memcpy(out.data() + i, o_output, 8); memcpy(out.data() + i, o_output, sizeof(DES_cblock));
// Next 8 bytes // Next sizeof(DES_cblock) bytes
i += 8; i += sizeof(DES_cblock);
// Clear everything // Clear everything
memset(o_message, 0, 9); memset(o_message, 0, sizeof(DES_cblock));
memset(o_output, 0, 9); memset(o_output, 0, sizeof(DES_cblock));
} }
free(o_message); free(o_message);

Loading…
Cancel
Save