From 5365018c35e0a496376bde9bf7e4bb4e9df6de2a Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Wed, 28 Dec 2022 20:35:34 +0100 Subject: StanzaError: Add NoType and NoCondition for -1 values Previsously static_cast(-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. --- src/base/QXmppStanza.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/base/QXmppStanza.h') 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. -- cgit v1.2.3