[Qt-interest] NTLMv1 HttpProxy in QT 4.5.3

Sergey sh0375 at gmail.com
Sat Jan 8 23:10:04 CET 2011


I found out how to solve this problem!

I made a change in D:\Qt\4.5.0-vc\qt\src\network\kernel\qauthenticator.cpp

static bool qNtlmDecodePhase2(const QByteArray& data, QNtlmPhase2Block& ch)
{
....
....
    if (ch.targetName.len > 0) {
        // this is original variant of QT:
        // if (ch.targetName.len + ch.targetName.offset >=
(unsigned)data.size())
        // I added -1 :
		if (ch.targetName.len + ch.targetName.offset - 1 >= (unsigned)data.size())
            return false;

        ch.targetNameStr =
qStringFromUcs2Le(data.mid(ch.targetName.offset, ch.targetName.len));
    }
....
....
}

Check, which i altered, is done to ensure that
data.mid(ch.targetName.offset, ch.targetName.len) will receive
ch.targetName.len bytes.
But variant of QT asked for one extra byte, which was not present in
my challenge.



More information about the Qt-interest-old mailing list