Commit b4c11c7c authored by Anton Kudryavtsev's avatar Anton Kudryavtsev Committed by Marc Mutz
Browse files

QComposeInputContext: reduce composeBuffer to QT_KEYSEQUENCE_MAX_LEN


The extra length has been used for a sentinel null value.
By checking the index before indexing into the array, that
extra element can be dropped.

Change-Id: I0b309420d8d89f75e2381a8065c8e68a1a33427c
Reviewed-by: default avatarMarc Mutz <marc.mutz@kdab.com>
Reviewed-by: default avatarLars Knoll <lars.knoll@theqtcompany.com>
parent 03dcc5c0
Branches
Tags
No related merge requests found
Showing with 2 additions and 2 deletions
...@@ -111,7 +111,7 @@ bool QComposeInputContext::filterEvent(const QEvent *event) ...@@ -111,7 +111,7 @@ bool QComposeInputContext::filterEvent(const QEvent *event)
keysym = keyEvent->nativeVirtualKey(); keysym = keyEvent->nativeVirtualKey();
int nCompose = 0; int nCompose = 0;
while (m_composeBuffer[nCompose] != 0 && nCompose < QT_KEYSEQUENCE_MAX_LEN) while (nCompose < QT_KEYSEQUENCE_MAX_LEN && m_composeBuffer[nCompose] != 0)
nCompose++; nCompose++;
if (nCompose == QT_KEYSEQUENCE_MAX_LEN) { if (nCompose == QT_KEYSEQUENCE_MAX_LEN) {
......
...@@ -68,7 +68,7 @@ protected: ...@@ -68,7 +68,7 @@ protected:
private: private:
QObject *m_focusObject; QObject *m_focusObject;
QVector<QComposeTableElement> m_composeTable; QVector<QComposeTableElement> m_composeTable;
uint m_composeBuffer[QT_KEYSEQUENCE_MAX_LEN + 1]; uint m_composeBuffer[QT_KEYSEQUENCE_MAX_LEN];
TableGenerator::TableState m_tableState; TableGenerator::TableState m_tableState;
bool m_compositionTableInitialized; bool m_compositionTableInitialized;
}; };
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment