jansson: update to 2.8.
This commit is contained in:
parent
f29be80a79
commit
a5eebe7d0a
2 changed files with 3 additions and 46 deletions
|
@ -1,43 +0,0 @@
|
||||||
--- src/jansson_config.h.in.orig 2016-05-04 11:43:48.386196000 +0800
|
|
||||||
+++ src/jansson_config.h.in 2016-05-04 11:44:21.204996000 +0800
|
|
||||||
@@ -36,4 +36,8 @@
|
|
||||||
otherwise to 0. */
|
|
||||||
#define JSON_HAVE_LOCALECONV @json_have_localeconv@
|
|
||||||
|
|
||||||
+/* Maximum recursion depth for parsing JSON input.
|
|
||||||
+ * This limits the depth of e.g. array-within-array constructions. */
|
|
||||||
+#define JSON_PARSER_MAX_DEPTH 2048
|
|
||||||
+
|
|
||||||
#endif
|
|
||||||
--- src/load.c.orig 2016-05-04 11:44:34.356957000 +0800
|
|
||||||
+++ src/load.c 2016-05-04 11:46:44.547307000 +0800
|
|
||||||
@@ -61,6 +61,7 @@ typedef struct {
|
|
||||||
typedef struct {
|
|
||||||
stream_t stream;
|
|
||||||
strbuffer_t saved_text;
|
|
||||||
+ size_t depth;
|
|
||||||
int token;
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
@@ -800,6 +801,12 @@ static json_t *parse_value(lex_t *lex, s
|
|
||||||
json_t *json;
|
|
||||||
double value;
|
|
||||||
|
|
||||||
+ lex->depth++;
|
|
||||||
+ if(lex->depth > JSON_PARSER_MAX_DEPTH) {
|
|
||||||
+ error_set(error, lex, "maximum parsing depth reached");
|
|
||||||
+ return NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
switch(lex->token) {
|
|
||||||
case TOKEN_STRING: {
|
|
||||||
const char *value = lex->value.string.val;
|
|
||||||
@@ -877,6 +884,8 @@ static json_t *parse_json(lex_t *lex, si
|
|
||||||
{
|
|
||||||
json_t *result;
|
|
||||||
|
|
||||||
+ lex->depth = 0;
|
|
||||||
+
|
|
||||||
lex_scan(lex, error);
|
|
||||||
if(!(flags & JSON_DECODE_ANY)) {
|
|
||||||
if(lex->token != '[' && lex->token != '{') {
|
|
|
@ -1,14 +1,14 @@
|
||||||
# Template file for 'jansson'
|
# Template file for 'jansson'
|
||||||
pkgname=jansson
|
pkgname=jansson
|
||||||
version=2.7
|
version=2.8
|
||||||
revision=2
|
revision=1
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
short_desc="Library for encoding, decoding and manipulating JSON data"
|
short_desc="Library for encoding, decoding and manipulating JSON data"
|
||||||
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
||||||
license="MIT"
|
license="MIT"
|
||||||
homepage="http://www.digip.org/jansson/"
|
homepage="http://www.digip.org/jansson/"
|
||||||
distfiles="http://www.digip.org/jansson/releases/jansson-${version}.tar.bz2"
|
distfiles="http://www.digip.org/jansson/releases/jansson-${version}.tar.bz2"
|
||||||
checksum=459f2b7cf22fb676286723f26169a17cf111fbfb6f54e3dc2ec6b6f9f4a97bdc
|
checksum=cf4682f317e2cb3cd69090c8602771a93effd43ea5970cf1444f542af9c631c4
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
vlicense LICENSE
|
vlicense LICENSE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue