import jansson-2.14-1.el8
This commit is contained in:
		
							parent
							
								
									075ea66116
								
							
						
					
					
						commit
						65fc6d22a0
					
				
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1 +1 @@ | ||||
| SOURCES/jansson-2.11.tar.bz2 | ||||
| SOURCES/jansson-2.14.tar.bz2 | ||||
|  | ||||
| @ -1 +1 @@ | ||||
| 02eedcc641c5770da423a0ea05e3a104bafd7ef1 SOURCES/jansson-2.11.tar.bz2 | ||||
| a85a87d4cd9a14a081e8e49cb6a2b54bde4fd6b9 SOURCES/jansson-2.14.tar.bz2 | ||||
|  | ||||
| @ -0,0 +1,25 @@ | ||||
| From 0677666f65b988b2dd44d02966a08fea490d5883 Mon Sep 17 00:00:00 2001 | ||||
| From: Petri Lehtinen <petri@digip.org> | ||||
| Date: Thu, 9 Sep 2021 21:53:11 +0300 | ||||
| Subject: [PATCH] Fix the check-exports tests for versioned symbols | ||||
| 
 | ||||
| ---
 | ||||
|  test/suites/api/check-exports | 2 +- | ||||
|  1 file changed, 1 insertion(+), 1 deletion(-) | ||||
| 
 | ||||
| diff --git a/test/suites/api/check-exports b/test/suites/api/check-exports
 | ||||
| index 2b6b3c7..5c82064 100755
 | ||||
| --- a/test/suites/api/check-exports
 | ||||
| +++ b/test/suites/api/check-exports
 | ||||
| @@ -15,7 +15,7 @@ grep 'json_\|jansson_' $top_srcdir/src/jansson.def \
 | ||||
|  nm -D $SOFILE >/dev/null >$test_log/symbols 2>/dev/null \ | ||||
|      || exit 77  # Skip if "nm -D" doesn't seem to work | ||||
|   | ||||
| -grep ' [DT] ' $test_log/symbols | cut -d' ' -f3 | grep -v '^_' | sort >$test_log/output
 | ||||
| +grep ' [DT] ' $test_log/symbols | cut -d' ' -f3 | grep -v '^_' | sed 's/@@libjansson.*//' | sort >$test_log/output
 | ||||
|   | ||||
|  if ! cmp -s $test_log/exports $test_log/output; then | ||||
|      diff -u $test_log/exports $test_log/output >&2 | ||||
| -- 
 | ||||
| 2.27.0 | ||||
| 
 | ||||
| @ -1,64 +0,0 @@ | ||||
| From 66e4ee795d21a30118f8503c966e9f9ae87db315 Mon Sep 17 00:00:00 2001 | ||||
| From: Xin Long <lucien.xin@gmail.com> | ||||
| Date: Wed, 25 Jul 2018 17:39:33 +0800 | ||||
| Subject: [PATCH] Call va_end after va_copy in json_vsprintf | ||||
| 
 | ||||
| As said in man doc: | ||||
|   "Each  invocation  of va_copy() must be matched by a corresponding | ||||
|    invocation of va_end() in the same function." | ||||
| 
 | ||||
| va_copy may alloc memory in some system, it's necessay to free it by | ||||
| va_end. | ||||
| 
 | ||||
| Fixes: efe6c7b3f2b3 ("Add json_sprintf and json_vsprintf") | ||||
| Signed-off-by: Xin Long <lucien.xin@gmail.com> | ||||
| ---
 | ||||
|  src/value.c | 17 ++++++++++++----- | ||||
|  1 file changed, 12 insertions(+), 5 deletions(-) | ||||
| 
 | ||||
| diff --git a/src/value.c b/src/value.c
 | ||||
| index 29a978c..861dce8 100644
 | ||||
| --- a/src/value.c
 | ||||
| +++ b/src/value.c
 | ||||
| @@ -781,26 +781,33 @@ static json_t *json_string_copy(const json_t *string)
 | ||||
|  } | ||||
|   | ||||
|  json_t *json_vsprintf(const char *fmt, va_list ap) { | ||||
| +    json_t *json = NULL;
 | ||||
|      int length; | ||||
|      char *buf; | ||||
|      va_list aq; | ||||
|      va_copy(aq, ap); | ||||
|   | ||||
|      length = vsnprintf(NULL, 0, fmt, ap); | ||||
| -    if (length == 0)
 | ||||
| -        return json_string("");
 | ||||
| +    if (length == 0) {
 | ||||
| +        json = json_string("");
 | ||||
| +        goto out;
 | ||||
| +    }
 | ||||
|   | ||||
|      buf = jsonp_malloc(length + 1); | ||||
|      if (!buf) | ||||
| -        return NULL;
 | ||||
| +        goto out;
 | ||||
|   | ||||
|      vsnprintf(buf, length + 1, fmt, aq); | ||||
|      if (!utf8_check_string(buf, length)) { | ||||
|          jsonp_free(buf); | ||||
| -        return NULL;
 | ||||
| +        goto out;
 | ||||
|      } | ||||
|   | ||||
| -    return jsonp_stringn_nocheck_own(buf, length);
 | ||||
| +    json = jsonp_stringn_nocheck_own(buf, length);
 | ||||
| +
 | ||||
| +out:
 | ||||
| +    va_end(aq);
 | ||||
| +    return json;
 | ||||
|  } | ||||
|   | ||||
|  json_t *json_sprintf(const char *fmt, ...) { | ||||
| -- 
 | ||||
| 2.1.0 | ||||
| 
 | ||||
| @ -1,53 +0,0 @@ | ||||
| From 81fe13eeed91d5c973db63d2f662ae766a8832c4 Mon Sep 17 00:00:00 2001 | ||||
| From: Corey Farrell <git@cfware.com> | ||||
| Date: Sat, 14 Jul 2018 13:24:55 -0400 | ||||
| Subject: [PATCH] Deal with warnings under gcc 8. | ||||
| 
 | ||||
| Recent versions of gcc have introduced compiler warnings for string | ||||
| operations that could be truncated.  This caused problems with -Werror. | ||||
| src/error.c used strncpy to write "..." to a string, but skipped writing | ||||
| the NUL terminator.  Switch this to use memcpy.  src/load.c produced | ||||
| warnings from snprintf writing error strings that could be truncated. | ||||
| Added code to autotools build to detect `-Wno-format-truncation', add it | ||||
| to AM_CFLAGS if supported. | ||||
| ---
 | ||||
|  configure.ac | 9 ++++++++- | ||||
|  src/error.c  | 2 +- | ||||
|  2 files changed, 9 insertions(+), 2 deletions(-) | ||||
| 
 | ||||
| diff --git a/configure.ac b/configure.ac
 | ||||
| index 4ab9d3d..ca12b59 100644
 | ||||
| --- a/configure.ac
 | ||||
| +++ b/configure.ac
 | ||||
| @@ -108,7 +108,14 @@ AC_DEFINE_UNQUOTED([INITIAL_HASHTABLE_ORDER], [$initial_hashtable_order],
 | ||||
|    [Number of buckets new object hashtables contain is 2 raised to this power. E.g. 3 -> 2^3 = 8.]) | ||||
|   | ||||
|  if test x$GCC = xyes; then | ||||
| -    AM_CFLAGS="-Wall -Wextra -Wdeclaration-after-statement"
 | ||||
| +    AC_MSG_CHECKING(for -Wno-format-truncation)
 | ||||
| +    wnoformat_truncation="-Wno-format-truncation"
 | ||||
| +    AS_IF([${CC} -Wno-format-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1],
 | ||||
| +      [AC_MSG_RESULT(yes)],
 | ||||
| +      [AC_MSG_RESULT(no)
 | ||||
| +      wnoformat_truncation=""])
 | ||||
| +
 | ||||
| +    AM_CFLAGS="-Wall -Wextra -Wdeclaration-after-statement ${wnoformat_truncation}"
 | ||||
|  fi | ||||
|  AC_SUBST([AM_CFLAGS]) | ||||
|   | ||||
| diff --git a/src/error.c b/src/error.c
 | ||||
| index cbd50d7..f5da6b9 100644
 | ||||
| --- a/src/error.c
 | ||||
| +++ b/src/error.c
 | ||||
| @@ -28,7 +28,7 @@ void jsonp_error_set_source(json_error_t *error, const char *source)
 | ||||
|          strncpy(error->source, source, length + 1); | ||||
|      else { | ||||
|          size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4; | ||||
| -        strncpy(error->source, "...", 3);
 | ||||
| +        memcpy(error->source, "...", 3);
 | ||||
|          strncpy(error->source + 3, source + extra, length - extra + 1); | ||||
|      } | ||||
|  } | ||||
| -- 
 | ||||
| 2.1.0 | ||||
| 
 | ||||
| @ -1,14 +1,13 @@ | ||||
| Name:		jansson | ||||
| Version:	2.11 | ||||
| Release:	3%{?dist} | ||||
| Version:	2.14 | ||||
| Release:	1%{?dist} | ||||
| Summary:	C library for encoding, decoding and manipulating JSON data | ||||
| 
 | ||||
| Group:		System Environment/Libraries | ||||
| License:	MIT | ||||
| URL:		http://www.digip.org/jansson/ | ||||
| Source0:	http://www.digip.org/jansson/releases/jansson-%{version}.tar.bz2 | ||||
| Patch1:		jansson-Deal-with-warnings-under-gcc-8.patch | ||||
| Patch2:		jansson-Call-va_end-after-va_copy-in-json_vsprintf.patch | ||||
| Source0:	https://github.com/akheron/jansson/releases/download/v%{version}/jansson-%{version}.tar.bz2 | ||||
| Patch1:		Fix-the-check-exports-tests-for-versioned-symbols.patch | ||||
| 
 | ||||
| BuildRequires:	gcc | ||||
| BuildRequires:	autoconf automake libtool | ||||
| @ -67,6 +66,10 @@ rm "$RPM_BUILD_ROOT%{_libdir}"/*.la | ||||
| %doc doc/_build/html/* | ||||
| 
 | ||||
| %changelog | ||||
| * Sun Nov 28 2021 Xin Long <lxin@redhat.com> - 2.14-1 | ||||
| - Rebase to 2.14 | ||||
|   Related: rhbz#2001062 | ||||
| 
 | ||||
| * Fri Aug 03 2018 Xin Long <lxin@redhat.com> - 2.11-3 | ||||
| - Deal with warnings under gcc 8 | ||||
| - Call va_end after va_copy in json_vsprintf | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user