Bump version to 1.5.2 (#311)
* Bump version to 1.5.2
* Fix bug due to uninitialized variable in qcbor_decode.c (#313)
In QCBORDecode_Private_ConsumeItem pbBreak is not set when the array is
empty. As a result if the calling function passes an uninitialized
value and the array is empty, the function may assume that the last
character has to be removed.
The issue was noticed by the GetMapAndArrayTest failing with code 59.
Changelog:
- In the branch of empty array, explicitly set pbBreak to false
- Add pbBreak param to the function comment
Tests:
- All tests pass in debug and release mode
Co-authored-by: Jean-Philippe Lemieux <1141657+jpl-mac@users.noreply.github.com>
---------
Co-authored-by: Laurence Lundblade <lgl@securitytheory.com>
Co-authored-by: jpl-mac <jpl-mac@users.noreply.github.com>
Co-authored-by: Jean-Philippe Lemieux <1141657+jpl-mac@users.noreply.github.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fac8f37..3537c27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@
project(qcbor
DESCRIPTION "QCBOR"
LANGUAGES C
- VERSION 1.5.1
+ VERSION 1.5.2
)
set(BUILD_QCBOR_TEST "OFF" CACHE STRING "Build QCBOR test suite [OFF, LIB, APP]")
diff --git a/README.md b/README.md
index 473517e..2862204 100644
--- a/README.md
+++ b/README.md
@@ -184,7 +184,7 @@
## Code Status
-The official current release is version 1.5.1. Changes over the last few
+The official current release is version 1.5.2. Changes over the last few
years have been only minor bug fixes, minor feature additions and
documentation improvements. QCBOR 1.x is highly stable.
diff --git a/inc/qcbor/qcbor_common.h b/inc/qcbor/qcbor_common.h
index f15d59a..c60db22 100644
--- a/inc/qcbor/qcbor_common.h
+++ b/inc/qcbor/qcbor_common.h
@@ -59,7 +59,7 @@
*/
#define QCBOR_VERSION_MAJOR 1
#define QCBOR_VERSION_MINOR 5
-#define QCBOR_VERSION_PATCH 1
+#define QCBOR_VERSION_PATCH 2
/**
diff --git a/pkg/qcbor.spec b/pkg/qcbor.spec
index 33d1661..a9619c6 100644
--- a/pkg/qcbor.spec
+++ b/pkg/qcbor.spec
@@ -6,7 +6,7 @@
Summary: A CBOR encoder/decoder library
URL: https://github.com/laurencelundblade/QCBOR
License: BSD-3-Clause
-Source0: %{URL}/archive/refs/tags/v1.5.1.tar.gz
+Source0: %{URL}/archive/refs/tags/v1.5.2.tar.gz
BuildRequires: cmake
BuildRequires: gcc
@@ -24,7 +24,7 @@
%prep
-%setup -q -n QCBOR-1.5.1
+%setup -q -n QCBOR-1.5.2
%cmake -DBUILD_QCBOR_TEST=APP
@@ -53,5 +53,9 @@
%changelog
+* Jun 16 2025 Laurence Lundblade <lgl@island-resort.com> - 1.5.2
+- Bug fix for QCBORDecode_GetMap() and QCBORDecode_GetArray()
+- Fix warning for compilers compliant with C23 standard
+- Minor documentation fix
* Jan 8 2024 Laurence Lundblade <lgl@island-resort.com> - 1.5.1
- Initial library RPM packaging.
diff --git a/src/qcbor_decode.c b/src/qcbor_decode.c
index 05e9c87..402683e 100644
--- a/src/qcbor_decode.c
+++ b/src/qcbor_decode.c
@@ -3139,6 +3139,8 @@
* @param[in] pMe The decoder context.
* @param[in] pItemToConsume The array/map whose contents are to be
* consumed.
+ * @param[out] pbBreak Set to true if extra break was consumed.
+ * Can be NULL.
* @param[out] puNextNestLevel The next nesting level after the item was
* fully consumed.
*
@@ -3178,8 +3180,11 @@
} else {
/* pItemToConsume is not a map or array. Just pass the nesting
- * level through. */
+ * level through. Ensure pbBreak is false. */
*puNextNestLevel = pItemToConsume->uNextNestLevel;
+ if(pbBreak) {
+ *pbBreak = false;
+ }
uReturn = QCBOR_SUCCESS;
}