Browse Source

Import jansson huge val fix

master
Con Kolivas 10 years ago
parent
commit
907e1c81d3
  1. 3
      src/jansson-2.6/src/strconv.c

3
src/jansson-2.6/src/strconv.c

@ -2,6 +2,7 @@
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "jansson_private.h"
#include "strbuffer.h"
@ -69,7 +70,7 @@ int jsonp_strtod(strbuffer_t *strbuffer, double *out)
value = strtod(strbuffer->value, &end);
assert(end == strbuffer->value + strbuffer->length);
if(errno == ERANGE && value != 0) {
if((value == HUGE_VAL || value == -HUGE_VAL) && errno == ERANGE) {
/* Overflow */
return -1;
}

Loading…
Cancel
Save