diff --git a/.pubnub.yml b/.pubnub.yml index 6313d751..13121ea8 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,7 +1,11 @@ name: c-core -version: 2.2.2 +version: 2.2.4 scm: github.com/pubnub/c-core changelog: + - version: v2.2.4 + changes: + - type: bug + text: Fix off-by-one error - version: v2.2.3 changes - type: bug diff --git a/VERSION b/VERSION index 58594069..530cdd91 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.3 +2.2.4 diff --git a/core/pubnub_coreapi_ex.c b/core/pubnub_coreapi_ex.c index 087c3b99..4eee1a39 100644 --- a/core/pubnub_coreapi_ex.c +++ b/core/pubnub_coreapi_ex.c @@ -35,7 +35,7 @@ enum pubnub_res pubnub_publish_ex(pubnub_t *pb, const char *channel, const char if (PUBNUB_CRYPTO_API && (NULL != opts.cipher_key)) { pubnub_bymebl_t to_encrypt; - size_t n = PUBNUB_BUF_MAXLEN - 2; + size_t n = PUBNUB_BUF_MAXLEN - sizeof("\"\""); to_encrypt.ptr = (uint8_t*)message; to_encrypt.size = strlen(message); @@ -43,9 +43,8 @@ enum pubnub_res pubnub_publish_ex(pubnub_t *pb, const char *channel, const char if (0 != pubnub_encrypt(opts.cipher_key, to_encrypt, encrypted_msg + 1, &n)) { return PNR_INTERNAL_ERROR; } - ++n; - encrypted_msg[n++] = '"'; - encrypted_msg[n] = '\0'; + encrypted_msg[++n] = '"'; + encrypted_msg[++n] = '\0'; message = encrypted_msg; } diff --git a/core/pubnub_netcore.c b/core/pubnub_netcore.c index ab41dd18..042977b2 100644 --- a/core/pubnub_netcore.c +++ b/core/pubnub_netcore.c @@ -495,6 +495,7 @@ int pbnc_fsm(struct pubnub_ *pb) break; case PNR_OK: if (strncmp(pb->core.http_buf, "HTTP/1.", 7) != 0) { + PUBNUB_LOG_ERROR("pb=%p bad HTTP response version: %.*s\n", pb, pbpal_read_len(pb), pb->core.http_buf); outcome_detected(pb, PNR_IO_ERROR); break; } @@ -505,6 +506,7 @@ int pbnc_fsm(struct pubnub_ *pb) pb->state = PBS_RX_HEADERS; goto next_state; default: + PUBNUB_LOG_ERROR("pb=%p in PBS_RX_HTTP_VER: failure inducing pbpal_line_read_status %d\n", pb, pbrslt); outcome_detected(pb, pbrslt); break; } diff --git a/freertos/pubnub_version_freertos.c b/freertos/pubnub_version_freertos.c index 64b65d0f..9188cfda 100644 --- a/freertos/pubnub_version_freertos.c +++ b/freertos/pubnub_version_freertos.c @@ -2,7 +2,7 @@ #include "pubnub_version.h" #define PUBNUB_SDK_NAME "FreeRTOS" -#define PUBNUB_SDK_VERSION "2.2.3" +#define PUBNUB_SDK_VERSION "2.2.4" char const *pubnub_sdk_name(void) diff --git a/microchip_harmony/pubnub_version_harmony.c b/microchip_harmony/pubnub_version_harmony.c index 5e229fc0..417d56f7 100644 --- a/microchip_harmony/pubnub_version_harmony.c +++ b/microchip_harmony/pubnub_version_harmony.c @@ -2,7 +2,7 @@ #include "pubnub_version.h" #define PUBNUB_SDK_NAME "Microchip.Harmony" -#define PUBNUB_SDK_VERSION "2.2.3" +#define PUBNUB_SDK_VERSION "2.2.4" char const *pubnub_sdk_name(void) diff --git a/posix/pubnub_version_posix.c b/posix/pubnub_version_posix.c index fd09c00c..1201a730 100644 --- a/posix/pubnub_version_posix.c +++ b/posix/pubnub_version_posix.c @@ -2,7 +2,7 @@ #include "pubnub_version.h" #define PUBNUB_SDK_NAME "POSIX" -#define PUBNUB_SDK_VERSION "2.2.3" +#define PUBNUB_SDK_VERSION "2.2.4" char const *pubnub_sdk_name(void) diff --git a/qt/pubnub_qt.cpp b/qt/pubnub_qt.cpp index ccb5466f..c5bb9107 100644 --- a/qt/pubnub_qt.cpp +++ b/qt/pubnub_qt.cpp @@ -517,7 +517,7 @@ void pubnub_qt::sslErrors(QNetworkReply* reply,const QList &errors) extern "C" char const *pubnub_sdk_name() { return "Qt5"; } -extern "C" char const *pubnub_uname() { return "Qt5%2F2.2.2"; } +extern "C" char const *pubnub_uname() { return "Qt5%2F2.2.4"; } -extern "C" char const *pubnub_version() { return "2.2.2"; } +extern "C" char const *pubnub_version() { return "2.2.4"; } diff --git a/windows/pubnub_version_windows.c b/windows/pubnub_version_windows.c index f3a5887f..9147fbc0 100644 --- a/windows/pubnub_version_windows.c +++ b/windows/pubnub_version_windows.c @@ -2,7 +2,7 @@ #include "pubnub_version.h" #define PUBNUB_SDK_NAME "Windows" -#define PUBNUB_SDK_VERSION "2.2.3" +#define PUBNUB_SDK_VERSION "2.2.4" char const *pubnub_sdk_name(void)