[trojita] [Bug 428078] SMTP AUTH Login truncates Base64 representation of username
https://bugs.kde.org/show_bug.cgi?id=428078 Espen Sandøy Hustad changed: What|Removed |Added Latest Commit||https://invent.kde.org/pim/ ||trojita/commit/64c4358c74ec ||c0c96a154cc066cba91d5503bbe ||7 Resolution|--- |FIXED Status|ASSIGNED|RESOLVED --- Comment #6 from Espen Sandøy Hustad --- Git commit 64c4358c74ecc0c96a154cc066cba91d5503bbe7 by Espen Sandøy Hustad, on behalf of Marcel Bosling. Committed on 31/03/2023 at 04:48. Pushed by jkt into branch 'master'. fix: SMTP auth login username base64 encoding Auto deduces buf to be QStringBuilder. This breaks base64 encoding of the username, which makes auth login fail. This also fixes a clazy warning: auto-unexpected-qstringbuilder. Thanks to Marcel Bosling for finding the issue, and providing this patch. M +1-1src/qwwsmtpclient/qwwsmtpclient.cpp https://invent.kde.org/pim/trojita/commit/64c4358c74ecc0c96a154cc066cba91d5503bbe7 -- You are receiving this mail because: You are watching all bug changes.
[trojita] [Bug 428078] SMTP AUTH Login truncates Base64 representation of username
https://bugs.kde.org/show_bug.cgi?id=428078 Bug Janitor Service changed: What|Removed |Added Status|CONFIRMED |ASSIGNED --- Comment #5 from Bug Janitor Service --- A possibly relevant merge request was started @ https://invent.kde.org/pim/trojita/-/merge_requests/34 -- You are receiving this mail because: You are watching all bug changes.
[trojita] [Bug 428078] SMTP AUTH Login truncates Base64 representation of username
https://bugs.kde.org/show_bug.cgi?id=428078 Espen Sandøy Hustad changed: What|Removed |Added CC||es...@ehustad.com Ever confirmed|0 |1 Status|REPORTED|CONFIRMED --- Comment #4 from Espen Sandøy Hustad --- I can confirm that this also happens with gcc (Gentoo 12.2.1_p20230304 p13) 12.2.1 20230304 -- You are receiving this mail because: You are watching all bug changes.
[trojita] [Bug 428078] SMTP AUTH Login truncates Base64 representation of username
https://bugs.kde.org/show_bug.cgi?id=428078 --- Comment #3 from Marcel Bosling --- Hi again, I've used typeid().name() on buf to see what type get's deduced from auto buf and for me it turns out to be the following mangeld type name: 14QStringBuilderI10QByteArrayA3_cE It seems that a QStringBuilder is indeed involved. This is on GCC 10.2.0. -- You are receiving this mail because: You are watching all bug changes.
[trojita] [Bug 428078] SMTP AUTH Login truncates Base64 representation of username
https://bugs.kde.org/show_bug.cgi?id=428078 --- Comment #2 from Marcel Bosling --- Hi Jan, indeed the statement is a leftover of my investigations. These are the results when using auto and QByteArray for buf: const QString &sername: "someexampleusern...@whereever.org" auto buf: "a\x00u\x00t\x00o\x00 \x00""b\r\n" QByteArray buf: "c29tZWV4YW1wbGV1c2VybmFtZUB3aGVyZWV2ZXIub3Jn\r\n" SIDENOTE: I've tried to reproduce the problem with a simple QT program doing just the conversion with auto and QByteArray. The resulting variables hold the same (correct) base64 encoded data, yielding: auto: "U29tZWxvbmd1c2VybmFtZUB3aGVyZWV2ZXIub3Jn\r\n" bufQB: "U29tZWxvbmd1c2VybmFtZUB3aGVyZWV2ZXIub3Jn\r\n" SOURCE: #include #include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); const QString username = "somelongusern...@whereever.org"; const QString &reftousername = username; auto bufAuto = reftousername.toUtf8().toBase64() + "\r\n"; QByteArray bufQB = reftousername.toUtf8().toBase64() + "\r\n"; qDebug()<<"auto: " << bufAuto; qDebug()<<"bufQB: " << bufQB; return a.exec(); } -- You are receiving this mail because: You are watching all bug changes.
[trojita] [Bug 428078] SMTP AUTH Login truncates Base64 representation of username
https://bugs.kde.org/show_bug.cgi?id=428078 --- Comment #1 from Jan Kundrát --- I do not understand how the proposed patch is supposed to fix the reported issue. Inclusion of looks like a leftover from some debugging. Instead of specifying type of that local variable as `auto`, it's now `QByteArray`. However, looking at the docs, `username` is a QString, then it calls toUtf8() which returns a QByteArray, then toBase64() which remains a QByteArray, and there's an operator+(QByteArray, const char*) which once again yields QByteArray. Unlike with QString, there's no QStringBuilder involved in there as far as I can tell. Are you sure you're *really* comparing results with the recent master, and then recent master with this particular patch applied? Can you share what's in `buf` before and after this patch? -- You are receiving this mail because: You are watching all bug changes.