From 9e36c91b468d7d821b77214337ff891811b4b337 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 5 Oct 2015 12:19:14 -0400 Subject: [PATCH] Fix insufficiently-portable regression test case. Some of the buildfarm members are evidently miserly enough of stack space to pass the originally-committed form of this test. Increase the requirement 10X to hopefully ensure that it fails as-expected everywhere. Security: CVE-2015-5289 --- src/test/regress/expected/json.out | 4 ++-- src/test/regress/expected/json_1.out | 4 ++-- src/test/regress/expected/jsonb.out | 4 ++-- src/test/regress/expected/jsonb_1.out | 4 ++-- src/test/regress/sql/json.sql | 4 ++-- src/test/regress/sql/jsonb.sql | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/test/regress/expected/json.out b/src/test/regress/expected/json.out index cb9a0a1eb3..5d33de00b1 100644 --- a/src/test/regress/expected/json.out +++ b/src/test/regress/expected/json.out @@ -233,10 +233,10 @@ DETAIL: Expected string, but found "3". CONTEXT: JSON data, line 1: {"abc":1,3... -- Recursion. SET max_stack_depth = '100kB'; -SELECT repeat('[', 1000)::json; +SELECT repeat('[', 10000)::json; ERROR: stack depth limit exceeded HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. -SELECT repeat('{"a":', 1000)::json; +SELECT repeat('{"a":', 10000)::json; ERROR: stack depth limit exceeded HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. RESET max_stack_depth; diff --git a/src/test/regress/expected/json_1.out b/src/test/regress/expected/json_1.out index fe63a72b39..a6e092cb8e 100644 --- a/src/test/regress/expected/json_1.out +++ b/src/test/regress/expected/json_1.out @@ -233,10 +233,10 @@ DETAIL: Expected string, but found "3". CONTEXT: JSON data, line 1: {"abc":1,3... -- Recursion. SET max_stack_depth = '100kB'; -SELECT repeat('[', 1000)::json; +SELECT repeat('[', 10000)::json; ERROR: stack depth limit exceeded HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. -SELECT repeat('{"a":', 1000)::json; +SELECT repeat('{"a":', 10000)::json; ERROR: stack depth limit exceeded HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. RESET max_stack_depth; diff --git a/src/test/regress/expected/jsonb.out b/src/test/regress/expected/jsonb.out index 148364d74b..c4e87707bd 100644 --- a/src/test/regress/expected/jsonb.out +++ b/src/test/regress/expected/jsonb.out @@ -241,10 +241,10 @@ DETAIL: Expected string, but found "3". CONTEXT: JSON data, line 1: {"abc":1,3... -- Recursion. SET max_stack_depth = '100kB'; -SELECT repeat('[', 1000)::jsonb; +SELECT repeat('[', 10000)::jsonb; ERROR: stack depth limit exceeded HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. -SELECT repeat('{"a":', 1000)::jsonb; +SELECT repeat('{"a":', 10000)::jsonb; ERROR: stack depth limit exceeded HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. RESET max_stack_depth; diff --git a/src/test/regress/expected/jsonb_1.out b/src/test/regress/expected/jsonb_1.out index 903dbd4c40..deb87dd2a6 100644 --- a/src/test/regress/expected/jsonb_1.out +++ b/src/test/regress/expected/jsonb_1.out @@ -241,10 +241,10 @@ DETAIL: Expected string, but found "3". CONTEXT: JSON data, line 1: {"abc":1,3... -- Recursion. SET max_stack_depth = '100kB'; -SELECT repeat('[', 1000)::jsonb; +SELECT repeat('[', 10000)::jsonb; ERROR: stack depth limit exceeded HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. -SELECT repeat('{"a":', 1000)::jsonb; +SELECT repeat('{"a":', 10000)::jsonb; ERROR: stack depth limit exceeded HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate. RESET max_stack_depth; diff --git a/src/test/regress/sql/json.sql b/src/test/regress/sql/json.sql index a173f06d95..da1ecbed4c 100644 --- a/src/test/regress/sql/json.sql +++ b/src/test/regress/sql/json.sql @@ -47,8 +47,8 @@ SELECT '{"abc":1,3}'::json; -- ERROR, no value -- Recursion. SET max_stack_depth = '100kB'; -SELECT repeat('[', 1000)::json; -SELECT repeat('{"a":', 1000)::json; +SELECT repeat('[', 10000)::json; +SELECT repeat('{"a":', 10000)::json; RESET max_stack_depth; -- Miscellaneous stuff. diff --git a/src/test/regress/sql/jsonb.sql b/src/test/regress/sql/jsonb.sql index f86b7fbf9b..25b5504fac 100644 --- a/src/test/regress/sql/jsonb.sql +++ b/src/test/regress/sql/jsonb.sql @@ -50,8 +50,8 @@ SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value -- Recursion. SET max_stack_depth = '100kB'; -SELECT repeat('[', 1000)::jsonb; -SELECT repeat('{"a":', 1000)::jsonb; +SELECT repeat('[', 10000)::jsonb; +SELECT repeat('{"a":', 10000)::jsonb; RESET max_stack_depth; -- Miscellaneous stuff. -- 2.40.0