mirror of
https://github.com/kgabis/parson.git
synced 2025-02-04 06:42:55 +08:00
1.5.2: fix Arithmetic overflow (#204)
* fix Arithmetic overflow * address PR comment and update version
This commit is contained in:
parent
aad7a80667
commit
60c37844d7
@ -3,7 +3,7 @@ project(parson C)
|
|||||||
|
|
||||||
include (GNUInstallDirs)
|
include (GNUInstallDirs)
|
||||||
|
|
||||||
set(PARSON_VERSION 1.5.1)
|
set(PARSON_VERSION 1.5.2)
|
||||||
add_library(parson parson.c)
|
add_library(parson parson.c)
|
||||||
target_include_directories(parson PUBLIC $<INSTALL_INTERFACE:include>)
|
target_include_directories(parson PUBLIC $<INSTALL_INTERFACE:include>)
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
project('parson', 'c',
|
project('parson', 'c',
|
||||||
version : '1.5.1',
|
version : '1.5.2',
|
||||||
license : 'MIT',
|
license : 'MIT',
|
||||||
meson_version : '>=0.46.0',
|
meson_version : '>=0.46.0',
|
||||||
default_options : [
|
default_options : [
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "parson",
|
"name": "parson",
|
||||||
"version": "1.5.1",
|
"version": "1.5.2",
|
||||||
"repo": "kgabis/parson",
|
"repo": "kgabis/parson",
|
||||||
"description": "Small json parser and reader",
|
"description": "Small json parser and reader",
|
||||||
"keywords": [ "json", "parser" ],
|
"keywords": [ "json", "parser" ],
|
||||||
|
6
parson.c
6
parson.c
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: MIT
|
SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
Parson 1.5.1 (https://github.com/kgabis/parson)
|
Parson 1.5.2 (https://github.com/kgabis/parson)
|
||||||
Copyright (c) 2012 - 2023 Krzysztof Gabis
|
Copyright (c) 2012 - 2023 Krzysztof Gabis
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#define PARSON_IMPL_VERSION_MAJOR 1
|
#define PARSON_IMPL_VERSION_MAJOR 1
|
||||||
#define PARSON_IMPL_VERSION_MINOR 5
|
#define PARSON_IMPL_VERSION_MINOR 5
|
||||||
#define PARSON_IMPL_VERSION_PATCH 1
|
#define PARSON_IMPL_VERSION_PATCH 2
|
||||||
|
|
||||||
#if (PARSON_VERSION_MAJOR != PARSON_IMPL_VERSION_MAJOR)\
|
#if (PARSON_VERSION_MAJOR != PARSON_IMPL_VERSION_MAJOR)\
|
||||||
|| (PARSON_VERSION_MINOR != PARSON_IMPL_VERSION_MINOR)\
|
|| (PARSON_VERSION_MINOR != PARSON_IMPL_VERSION_MINOR)\
|
||||||
@ -441,7 +441,7 @@ static JSON_Status json_object_init(JSON_Object *object, size_t capacity) {
|
|||||||
|
|
||||||
object->count = 0;
|
object->count = 0;
|
||||||
object->cell_capacity = capacity;
|
object->cell_capacity = capacity;
|
||||||
object->item_capacity = (unsigned int)(capacity * 0.7f);
|
object->item_capacity = (unsigned int)(capacity * 7/10);
|
||||||
|
|
||||||
if (capacity == 0) {
|
if (capacity == 0) {
|
||||||
return JSONSuccess;
|
return JSONSuccess;
|
||||||
|
6
parson.h
6
parson.h
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: MIT
|
SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
Parson 1.5.1 (https://github.com/kgabis/parson)
|
Parson 1.5.2 (https://github.com/kgabis/parson)
|
||||||
Copyright (c) 2012 - 2023 Krzysztof Gabis
|
Copyright (c) 2012 - 2023 Krzysztof Gabis
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@ -36,9 +36,9 @@ extern "C"
|
|||||||
|
|
||||||
#define PARSON_VERSION_MAJOR 1
|
#define PARSON_VERSION_MAJOR 1
|
||||||
#define PARSON_VERSION_MINOR 5
|
#define PARSON_VERSION_MINOR 5
|
||||||
#define PARSON_VERSION_PATCH 1
|
#define PARSON_VERSION_PATCH 2
|
||||||
|
|
||||||
#define PARSON_VERSION_STRING "1.5.1"
|
#define PARSON_VERSION_STRING "1.5.2"
|
||||||
|
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user