Skip to content

Commit f1d2a1f

Browse files
authored
Merge pull request #296 from wravery/json-double-fallback
Fallback to parsing out-of-bounds 32-bit integers in JSON as doubles
2 parents 2dd4cc1 + 8b3a653 commit f1d2a1f

File tree

13 files changed

+28
-28
lines changed

13 files changed

+28
-28
lines changed

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4.1.3
1616
with:
1717
submodules: true
1818

.github/workflows/macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ jobs:
99
matrix:
1010
config: [Debug, Release]
1111

12-
runs-on: macos-latest
12+
runs-on: macos-13
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4.1.3
1616
with:
1717
submodules: true
1818

1919
- name: Cache vcpkg
20-
uses: actions/cache@v3
20+
uses: actions/cache@v4.0.2
2121
id: cache-vcpkg
2222
with:
2323
path: build/vcpkg_cache/

.github/workflows/windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: windows-latest
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4.1.3
1818
with:
1919
submodules: true
2020

@@ -24,7 +24,7 @@ jobs:
2424
run: echo "vcpkg_triplet=${{ matrix.arch }}-windows$(if ('${{ matrix.libs }}' -eq 'static') { '-static' })" >> $env:GITHUB_OUTPUT
2525

2626
- name: Cache vcpkg
27-
uses: actions/cache@v3
27+
uses: actions/cache@v4.0.2
2828
id: cache-vcpkg
2929
with:
3030
path: build/vcpkg_cache/

cmake/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.5.5
1+
4.5.6

include/graphqlservice/internal/Version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
namespace graphql::internal {
1212

13-
constexpr std::string_view FullVersion { "4.5.5" };
13+
constexpr std::string_view FullVersion { "4.5.6" };
1414

1515
constexpr size_t MajorVersion = 4;
1616
constexpr size_t MinorVersion = 5;
17-
constexpr size_t PatchVersion = 5;
17+
constexpr size_t PatchVersion = 6;
1818

1919
} // namespace graphql::internal
2020

res/ClientGen.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,5,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.5"
6+
#define GRAPHQL_RC_VERSION 4,5,6,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.6"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/SchemaGen.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,5,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.5"
6+
#define GRAPHQL_RC_VERSION 4,5,6,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.6"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/graphqlclient_version.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,5,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.5"
6+
#define GRAPHQL_RC_VERSION 4,5,6,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.6"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/graphqljson_version.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,5,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.5"
6+
#define GRAPHQL_RC_VERSION 4,5,6,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.6"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/graphqlpeg_version.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,5,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.5"
6+
#define GRAPHQL_RC_VERSION 4,5,6,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.6"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/graphqlresponse_version.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,5,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.5"
6+
#define GRAPHQL_RC_VERSION 4,5,6,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.6"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

res/graphqlservice_version.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include <winver.h>
55

6-
#define GRAPHQL_RC_VERSION 4,5,5,0
7-
#define GRAPHQL_RC_VERSION_STR "4.5.5"
6+
#define GRAPHQL_RC_VERSION 4,5,6,0
7+
#define GRAPHQL_RC_VERSION_STR "4.5.6"
88

99
#ifndef DEBUG
1010
#define VER_DEBUG 0

src/JSONResponse.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,21 @@ struct ResponseHandler : rapidjson::BaseReaderHandler<rapidjson::UTF8<>, Respons
132132
if (i > static_cast<unsigned int>(std::numeric_limits<int>::max()))
133133
{
134134
// https://spec.graphql.org/October2021/#sec-Int
135-
throw std::overflow_error("GraphQL only supports 32-bit signed integers");
135+
return Double(static_cast<double>(i));
136136
}
137137
return Int(static_cast<int>(i));
138138
}
139139

140-
bool Int64(int64_t /*i*/)
140+
bool Int64(int64_t i)
141141
{
142142
// https://spec.graphql.org/October2021/#sec-Int
143-
throw std::overflow_error("GraphQL only supports 32-bit signed integers");
143+
return Double(static_cast<double>(i));
144144
}
145145

146-
bool Uint64(uint64_t /*i*/)
146+
bool Uint64(uint64_t i)
147147
{
148148
// https://spec.graphql.org/October2021/#sec-Int
149-
throw std::overflow_error("GraphQL only supports 32-bit signed integers");
149+
return Double(static_cast<double>(i));
150150
}
151151

152152
bool Double(double d)

0 commit comments

Comments
 (0)