diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-12-28 20:35:34 +0100 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-12-28 20:38:05 +0100 |
| commit | 5365018c35e0a496376bde9bf7e4bb4e9df6de2a (patch) | |
| tree | 4eed5a451af86a0b5693bc8a90fa1aa99678048c /src/base/QXmppStanza.h | |
| parent | 4f0a029070091d11ab3d2e17e30e39b4476105e5 (diff) | |
| download | qxmpp-5365018c35e0a496376bde9bf7e4bb4e9df6de2a.tar.gz | |
StanzaError: Add NoType and NoCondition for -1 values
Previsously static_cast<QXmppStanza::Error::Condition>(-1) was used when
no condition was set (or type). This adds real enum values with that
integer value to avoid undefined behaviour.
Fixes #495.
Diffstat (limited to 'src/base/QXmppStanza.h')
| -rw-r--r-- | src/base/QXmppStanza.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/base/QXmppStanza.h b/src/base/QXmppStanza.h index 394bc6c6..320bab26 100644 --- a/src/base/QXmppStanza.h +++ b/src/base/QXmppStanza.h @@ -98,6 +98,7 @@ public: /// The error descriptions are not detailed in here. The exact meaning /// can be found in the particular protocols using them. enum Type { + NoType = -1, Cancel, ///< The error is not temporary. Continue, ///< The error was only a warning. Modify, ///< The request needs to be changed and resent. @@ -107,6 +108,7 @@ public: /// A detailed condition of the error enum Condition { + NoCondition = -1, BadRequest, ///< The request does not contain a valid schema. Conflict, ///< The request conflicts with another. FeatureNotImplemented, ///< The feature is not implemented. |
