Skip to content

Commit

Permalink
Merge pull request #296 from wravery/json-double-fallback
Browse files Browse the repository at this point in the history
Fallback to parsing out-of-bounds 32-bit integers in JSON as doubles
  • Loading branch information
wravery authored Apr 23, 2024
2 parents 2dd4cc1 + 8b3a653 commit f1d2a1f
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.3
with:
submodules: true

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
matrix:
config: [Debug, Release]

runs-on: macos-latest
runs-on: macos-13

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.3
with:
submodules: true

- name: Cache vcpkg
uses: actions/cache@v3
uses: actions/cache@v4.0.2
id: cache-vcpkg
with:
path: build/vcpkg_cache/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.3
with:
submodules: true

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

- name: Cache vcpkg
uses: actions/cache@v3
uses: actions/cache@v4.0.2
id: cache-vcpkg
with:
path: build/vcpkg_cache/
Expand Down
2 changes: 1 addition & 1 deletion cmake/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.5.5
4.5.6
4 changes: 2 additions & 2 deletions include/graphqlservice/internal/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

namespace graphql::internal {

constexpr std::string_view FullVersion { "4.5.5" };
constexpr std::string_view FullVersion { "4.5.6" };

constexpr size_t MajorVersion = 4;
constexpr size_t MinorVersion = 5;
constexpr size_t PatchVersion = 5;
constexpr size_t PatchVersion = 6;

} // namespace graphql::internal

Expand Down
4 changes: 2 additions & 2 deletions res/ClientGen.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <winver.h>

#define GRAPHQL_RC_VERSION 4,5,5,0
#define GRAPHQL_RC_VERSION_STR "4.5.5"
#define GRAPHQL_RC_VERSION 4,5,6,0
#define GRAPHQL_RC_VERSION_STR "4.5.6"

#ifndef DEBUG
#define VER_DEBUG 0
Expand Down
4 changes: 2 additions & 2 deletions res/SchemaGen.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <winver.h>

#define GRAPHQL_RC_VERSION 4,5,5,0
#define GRAPHQL_RC_VERSION_STR "4.5.5"
#define GRAPHQL_RC_VERSION 4,5,6,0
#define GRAPHQL_RC_VERSION_STR "4.5.6"

#ifndef DEBUG
#define VER_DEBUG 0
Expand Down
4 changes: 2 additions & 2 deletions res/graphqlclient_version.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <winver.h>

#define GRAPHQL_RC_VERSION 4,5,5,0
#define GRAPHQL_RC_VERSION_STR "4.5.5"
#define GRAPHQL_RC_VERSION 4,5,6,0
#define GRAPHQL_RC_VERSION_STR "4.5.6"

#ifndef DEBUG
#define VER_DEBUG 0
Expand Down
4 changes: 2 additions & 2 deletions res/graphqljson_version.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <winver.h>

#define GRAPHQL_RC_VERSION 4,5,5,0
#define GRAPHQL_RC_VERSION_STR "4.5.5"
#define GRAPHQL_RC_VERSION 4,5,6,0
#define GRAPHQL_RC_VERSION_STR "4.5.6"

#ifndef DEBUG
#define VER_DEBUG 0
Expand Down
4 changes: 2 additions & 2 deletions res/graphqlpeg_version.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <winver.h>

#define GRAPHQL_RC_VERSION 4,5,5,0
#define GRAPHQL_RC_VERSION_STR "4.5.5"
#define GRAPHQL_RC_VERSION 4,5,6,0
#define GRAPHQL_RC_VERSION_STR "4.5.6"

#ifndef DEBUG
#define VER_DEBUG 0
Expand Down
4 changes: 2 additions & 2 deletions res/graphqlresponse_version.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <winver.h>

#define GRAPHQL_RC_VERSION 4,5,5,0
#define GRAPHQL_RC_VERSION_STR "4.5.5"
#define GRAPHQL_RC_VERSION 4,5,6,0
#define GRAPHQL_RC_VERSION_STR "4.5.6"

#ifndef DEBUG
#define VER_DEBUG 0
Expand Down
4 changes: 2 additions & 2 deletions res/graphqlservice_version.rc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <winver.h>

#define GRAPHQL_RC_VERSION 4,5,5,0
#define GRAPHQL_RC_VERSION_STR "4.5.5"
#define GRAPHQL_RC_VERSION 4,5,6,0
#define GRAPHQL_RC_VERSION_STR "4.5.6"

#ifndef DEBUG
#define VER_DEBUG 0
Expand Down
10 changes: 5 additions & 5 deletions src/JSONResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,21 @@ struct ResponseHandler : rapidjson::BaseReaderHandler<rapidjson::UTF8<>, Respons
if (i > static_cast<unsigned int>(std::numeric_limits<int>::max()))
{
// https://spec.graphql.org/October2021/#sec-Int
throw std::overflow_error("GraphQL only supports 32-bit signed integers");
return Double(static_cast<double>(i));
}
return Int(static_cast<int>(i));
}

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

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

bool Double(double d)
Expand Down

0 comments on commit f1d2a1f

Please sign in to comment.