Skip to content

Commit 868b79a

Browse files
committed
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
1 parent 5d250a8 commit 868b79a

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

src/test/regress/expected/json.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ DETAIL: Expected string, but found "3".
233233
CONTEXT: JSON data, line 1: {"abc":1,3...
234234
-- Recursion.
235235
SET max_stack_depth = '100kB';
236-
SELECT repeat('[', 1000)::json;
236+
SELECT repeat('[', 10000)::json;
237237
ERROR: stack depth limit exceeded
238238
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
239-
SELECT repeat('{"a":', 1000)::json;
239+
SELECT repeat('{"a":', 10000)::json;
240240
ERROR: stack depth limit exceeded
241241
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
242242
RESET max_stack_depth;

src/test/regress/expected/json_1.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ DETAIL: Expected string, but found "3".
233233
CONTEXT: JSON data, line 1: {"abc":1,3...
234234
-- Recursion.
235235
SET max_stack_depth = '100kB';
236-
SELECT repeat('[', 1000)::json;
236+
SELECT repeat('[', 10000)::json;
237237
ERROR: stack depth limit exceeded
238238
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
239-
SELECT repeat('{"a":', 1000)::json;
239+
SELECT repeat('{"a":', 10000)::json;
240240
ERROR: stack depth limit exceeded
241241
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
242242
RESET max_stack_depth;

src/test/regress/expected/jsonb.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,10 @@ DETAIL: Expected string, but found "3".
241241
CONTEXT: JSON data, line 1: {"abc":1,3...
242242
-- Recursion.
243243
SET max_stack_depth = '100kB';
244-
SELECT repeat('[', 1000)::jsonb;
244+
SELECT repeat('[', 10000)::jsonb;
245245
ERROR: stack depth limit exceeded
246246
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
247-
SELECT repeat('{"a":', 1000)::jsonb;
247+
SELECT repeat('{"a":', 10000)::jsonb;
248248
ERROR: stack depth limit exceeded
249249
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
250250
RESET max_stack_depth;

src/test/regress/expected/jsonb_1.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,10 @@ DETAIL: Expected string, but found "3".
241241
CONTEXT: JSON data, line 1: {"abc":1,3...
242242
-- Recursion.
243243
SET max_stack_depth = '100kB';
244-
SELECT repeat('[', 1000)::jsonb;
244+
SELECT repeat('[', 10000)::jsonb;
245245
ERROR: stack depth limit exceeded
246246
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
247-
SELECT repeat('{"a":', 1000)::jsonb;
247+
SELECT repeat('{"a":', 10000)::jsonb;
248248
ERROR: stack depth limit exceeded
249249
HINT: Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.
250250
RESET max_stack_depth;

src/test/regress/sql/json.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ SELECT '{"abc":1,3}'::json; -- ERROR, no value
4747

4848
-- Recursion.
4949
SET max_stack_depth = '100kB';
50-
SELECT repeat('[', 1000)::json;
51-
SELECT repeat('{"a":', 1000)::json;
50+
SELECT repeat('[', 10000)::json;
51+
SELECT repeat('{"a":', 10000)::json;
5252
RESET max_stack_depth;
5353

5454
-- Miscellaneous stuff.

src/test/regress/sql/jsonb.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ SELECT '{"abc":1,3}'::jsonb; -- ERROR, no value
5050

5151
-- Recursion.
5252
SET max_stack_depth = '100kB';
53-
SELECT repeat('[', 1000)::jsonb;
54-
SELECT repeat('{"a":', 1000)::jsonb;
53+
SELECT repeat('[', 10000)::jsonb;
54+
SELECT repeat('{"a":', 10000)::jsonb;
5555
RESET max_stack_depth;
5656

5757
-- Miscellaneous stuff.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy