From 9234b94c8ed3a041cb5d78bc63e17c88b895fb6c Mon Sep 17 00:00:00 2001 From: Frank Elias <69520919+FrankElias77@users.noreply.github.com> Date: Fri, 4 Jun 2021 17:20:22 -0400 Subject: [PATCH 1/2] Fix for potential memory leak in the bson_array.c file (#55) * bson_array_from_bytes_len func update deinitialize unused var * bson_object update Condition update in bson_object_from_bytes_len --- src/bson_array.c | 2 +- src/bson_object.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bson_array.c b/src/bson_array.c index 139a796..9726bba 100644 --- a/src/bson_array.c +++ b/src/bson_array.c @@ -288,7 +288,7 @@ size_t bson_array_from_bytes_len(BsonArray *output, const uint8_t *data, size_t } } - if (parseError) { + if (parseError || dataSize - remainBytes == 0) { bson_array_deinitialize(&array); return 0; } diff --git a/src/bson_object.c b/src/bson_object.c index 3f86acc..a24ba54 100644 --- a/src/bson_object.c +++ b/src/bson_object.c @@ -309,7 +309,7 @@ size_t bson_object_from_bytes_len(BsonObject *output, const uint8_t *data, size_ } } - if (parseError) { + if (parseError || dataSize - remainBytes == 0) { bson_object_deinitialize(&obj); return 0; } From ef1d49d51a11be4d5e896cdbdec83d8c00a26d56 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Fri, 4 Jun 2021 17:26:56 -0400 Subject: [PATCH 2/2] Update library versions for each platform to 1.2.5 (#56) --- BiSON.podspec | 2 +- BsonJavaPort/bson_java_port/build.gradle | 2 +- BsonJavaPort/bson_java_port/gradle.properties | 2 +- README.md | 2 +- configure | 24 +++++++++---------- configure.ac | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/BiSON.podspec b/BiSON.podspec index 80c8d0c..82d6d43 100644 --- a/BiSON.podspec +++ b/BiSON.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # s.name = "BiSON" - s.version = "1.2.3" + s.version = "1.2.5" s.summary = "A portable BSON C library" diff --git a/BsonJavaPort/bson_java_port/build.gradle b/BsonJavaPort/bson_java_port/build.gradle index b5dc06e..11a91ce 100644 --- a/BsonJavaPort/bson_java_port/build.gradle +++ b/BsonJavaPort/bson_java_port/build.gradle @@ -6,7 +6,7 @@ android { minSdkVersion 8 targetSdkVersion 26 versionCode 2 - versionName "1.2.4" + versionName "1.2.5" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" ndk{ abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" diff --git a/BsonJavaPort/bson_java_port/gradle.properties b/BsonJavaPort/bson_java_port/gradle.properties index 7951444..5ec0d48 100644 --- a/BsonJavaPort/bson_java_port/gradle.properties +++ b/BsonJavaPort/bson_java_port/gradle.properties @@ -1,6 +1,6 @@ GROUP=com.smartdevicelink POM_ARTIFACT_ID=bson_java_port -VERSION_NAME=1.2.4 +VERSION_NAME=1.2.5 POM_NAME=bson_java_port POM_PACKAGING=aar diff --git a/README.md b/README.md index 19d08ef..d6baf79 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ There is a jCenter artifact for Android. Add the following to your `build.gradle ``` dependencies { - compile ('com.smartdevicelink:bson_java_port:1.2.2') + api 'com.smartdevicelink:bson_java_port:1.2.5' } ``` diff --git a/configure b/configure index e477f16..fa941d8 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for bson_c_lib 1.2.4. +# Generated by GNU Autoconf 2.69 for bson_c_lib 1.2.5. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bson_c_lib' PACKAGE_TARNAME='bson_c_lib' -PACKAGE_VERSION='1.2.4' -PACKAGE_STRING='bson_c_lib 1.2.4' +PACKAGE_VERSION='1.2.5' +PACKAGE_STRING='bson_c_lib 1.2.5' PACKAGE_BUGREPORT='jacob@livio.io' PACKAGE_URL='' @@ -1357,7 +1357,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bson_c_lib 1.2.4 to adapt to many kinds of systems. +\`configure' configures bson_c_lib 1.2.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1428,7 +1428,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bson_c_lib 1.2.4:";; + short | recursive ) echo "Configuration of bson_c_lib 1.2.5:";; esac cat <<\_ACEOF @@ -1553,7 +1553,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bson_c_lib configure 1.2.4 +bson_c_lib configure 1.2.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2106,7 +2106,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bson_c_lib $as_me 1.2.4, which was +It was created by bson_c_lib $as_me 1.2.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2969,7 +2969,7 @@ fi # Define the identity of the package. PACKAGE='bson_c_lib' - VERSION='1.2.4' + VERSION='1.2.5' cat >>confdefs.h <<_ACEOF @@ -12749,7 +12749,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bson_c_lib $as_me 1.2.4, which was +This file was extended by bson_c_lib $as_me 1.2.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12815,7 +12815,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -bson_c_lib config.status 1.2.4 +bson_c_lib config.status 1.2.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -16848,7 +16848,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bson_c_lib $as_me 1.2.4, which was +This file was extended by bson_c_lib $as_me 1.2.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16914,7 +16914,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -bson_c_lib config.status 1.2.4 +bson_c_lib config.status 1.2.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 9e512b0..75cd005 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT(bson_c_lib, 1.2.4, jacob@livio.io) +AC_INIT(bson_c_lib, 1.2.5, jacob@livio.io) AM_INIT_AUTOMAKE([subdir-objects foreign -Wall]) AM_MAINTAINER_MODE AC_CONFIG_MACRO_DIRS([m4])