diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2012-08-14 22:53:04 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2012-08-14 22:53:04 +0200 |
commit | b3e0cd2d558b5ccf06c816eed38c883d7462d3d4 (patch) | |
tree | 5e861b6352d21797963b7c195a72680fbb8a1784 | |
parent | 08c75fa2b17a2d81328abaa866e9b7534a5bcee6 (diff) | |
download | fetchmail-b3e0cd2d558b5ccf06c816eed38c883d7462d3d4.tar.gz fetchmail-b3e0cd2d558b5ccf06c816eed38c883d7462d3d4.tar.bz2 fetchmail-b3e0cd2d558b5ccf06c816eed38c883d7462d3d4.zip |
Fix compiler warnings.
-rw-r--r-- | ntlmsubr.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -55,8 +55,12 @@ int ntlm_helper(int sock, struct query *ctl, const char *proto) if ((result = gen_recv(sock, msgbuf, sizeof msgbuf))) goto cancelfail; + /* + * < 0: decoding error + * >= 0 < 32: too short to be plausible + */ if ((result = from64tobits (&challenge, msgbuf, sizeof(challenge))) < 0 - || result < ((void *)&challenge.context - (void *)&challenge)) + || result < 32) { report (stderr, GT_("could not decode BASE64 challenge\n")); /* We do not goto cancelfail; the server has already sent the @@ -73,9 +77,9 @@ int ntlm_helper(int sock, struct query *ctl, const char *proto) * - that offset + length is not bigger than buffer */ if (0 != memcmp("NTLMSSP", challenge.ident, 8) || challenge.msgType != 2 - || challenge.uDomain.offset > result - || challenge.uDomain.offset + challenge.uDomain.len < challenge.uDomain.offset - || challenge.uDomain.offset + challenge.uDomain.len > result) + || challenge.uDomain.offset > (unsigned)result + || (challenge.uDomain.offset + challenge.uDomain.len) < challenge.uDomain.offset + || (challenge.uDomain.offset + challenge.uDomain.len) > (unsigned)result) { report (stderr, GT_("NTLM challenge contains invalid data.\n")); result = PS_AUTHFAIL; |