blob: d29d9118dc4cffee84d4290c201a330a612d0be1 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From 9be71700eb580c815688584a64621a38867c3fdd Mon Sep 17 00:00:00 2001
2From: James Myatt <james.myatt@tessella.com>
3Date: Thu, 5 Feb 2015 15:57:14 +0000
4Subject: [PATCH] json_tokener requires INF and NAN
5
6---
7Upstream-Status: Backport
8
9 json_tokener.c | 3 ++-
10 1 file changed, 2 insertions(+), 1 deletion(-)
11
12Index: json-c-0.12/json_tokener.c
13===================================================================
14--- json-c-0.12.orig/json_tokener.c
15+++ json-c-0.12/json_tokener.c
16@@ -16,6 +16,7 @@
17 #include "config.h"
18
19 #include <math.h>
20+#include "math_compat.h"
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <stddef.h>
24@@ -352,12 +353,10 @@ struct json_object* json_tokener_parse_e
25
26 case json_tokener_state_inf: /* aka starts with 'i' */
27 {
28- int size;
29- int size_inf;
30+ size_t size_inf;
31 int is_negative = 0;
32
33 printbuf_memappend_fast(tok->pb, &c, 1);
34- size = json_min(tok->st_pos+1, json_null_str_len);
35 size_inf = json_min(tok->st_pos+1, json_inf_str_len);
36 char *infbuf = tok->pb->buf;
37 if (*infbuf == '-')