From: Joshua Goins Date: Mon, 7 Jul 2025 01:50:54 +0000 (-0400) Subject: [PATCH] Fix crash when trying to save less than the max number of fields X-Git-Tag: archive/raspbian/25.04.3-1+rpi1^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=98112eee8f462da69d6f990eb72aac5337b95ffe;p=tokodon.git [PATCH] Fix crash when trying to save less than the max number of fields (cherry picked from commit 049ce8700af96134a0fcfc575016514b4ae0e912) Gbp-Pq: Name upstream_9eb657e1_Fix-crash-when-trying-to-save-less-than-the-max-number-of-fields.patch --- diff --git a/src/account/profileeditor.cpp b/src/account/profileeditor.cpp index 17c7700..2cdd347 100644 --- a/src/account/profileeditor.cpp +++ b/src/account/profileeditor.cpp @@ -285,7 +285,7 @@ void ProfileEditorBackend::save() discoverablePart.setBody(discoverable() ? "1" : "0"); multiPart->append(discoverablePart); - for (int i = 0; i < maxFields(); i++) { + for (int i = 0; i < m_fields.size(); i++) { QHttpPart fieldNamePart; fieldNamePart.setHeader(QNetworkRequest::ContentDispositionHeader, QStringLiteral("form-data; name=\"fields_attributes[%1][name]\"").arg(i)); fieldNamePart.setBody(m_fields[i]["name"_L1].toString().toUtf8());