~ubuntu-branches/ubuntu/utopic/postgresql-9.4/utopic-security

« back to all changes in this revision

Viewing changes to src/test/regress/expected/json_1.out

  • Committer: Package Import Robot
  • Author(s): Martin Pitt, CVE-2014-8161
  • Date: 2015-02-06 12:31:46 UTC
  • mfrom: (1.1.5) (7.1.2 utopic-proposed)
  • Revision ID: package-import@ubuntu.com-20150206123146-vtmf30jbkm7w16p8
Tags: 9.4.1-0ubuntu0.14.10
* New upstream security/bug fix release (LP: #1418928)
  - Fix buffer overruns in to_char() [CVE-2015-0241]
  - Fix buffer overruns in contrib/pgcrypto [CVE-2015-0243]
  - Fix possible loss of frontend/backend protocol synchronization after an
    error [CVE-2015-0244]
  - Fix information leak via constraint-violation error messages
    [CVE-2014-8161]
  - See release notes for details about other fixes:
    http://www.postgresql.org/about/news/1569/

Show diffs side-by-side

added added

removed removed

Lines of Context:
426
426
(1 row)
427
427
 
428
428
COMMIT;
429
 
select to_json(text '\uabcd');
430
 
 to_json  
431
 
----------
432
 
 "\uabcd"
433
 
(1 row)
434
 
 
435
 
select to_json(text '\abcd');
436
 
 to_json  
437
 
----------
438
 
 "\\abcd"
439
 
(1 row)
440
 
 
441
429
--json_agg
442
430
SELECT json_agg(q)
443
431
  FROM ( SELECT $$a$$ || x AS b, y AS c,
1378
1364
 
1379
1365
-- handling of unicode surrogate pairs
1380
1366
select json '{ "a":  "\ud83d\ude04\ud83d\udc36" }' -> 'a' as correct_in_utf8;
1381
 
ERROR:  invalid input syntax for type json
 
1367
ERROR:  unsupported Unicode escape sequence
1382
1368
DETAIL:  Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8.
1383
1369
CONTEXT:  JSON data, line 1: { "a":...
1384
1370
select json '{ "a":  "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
1398
1384
DETAIL:  Unicode low surrogate must follow a high surrogate.
1399
1385
CONTEXT:  JSON data, line 1: { "a":...
1400
1386
--handling of simple unicode escapes
 
1387
select json '{ "a":  "the Copyright \u00a9 sign" }' as correct_in_utf8;
 
1388
            correct_in_utf8            
 
1389
---------------------------------------
 
1390
 { "a":  "the Copyright \u00a9 sign" }
 
1391
(1 row)
 
1392
 
 
1393
select json '{ "a":  "dollar \u0024 character" }' as correct_everywhere;
 
1394
         correct_everywhere          
 
1395
-------------------------------------
 
1396
 { "a":  "dollar \u0024 character" }
 
1397
(1 row)
 
1398
 
 
1399
select json '{ "a":  "dollar \\u0024 character" }' as not_an_escape;
 
1400
            not_an_escape             
 
1401
--------------------------------------
 
1402
 { "a":  "dollar \\u0024 character" }
 
1403
(1 row)
 
1404
 
 
1405
select json '{ "a":  "null \u0000 escape" }' as not_unescaped;
 
1406
         not_unescaped          
 
1407
--------------------------------
 
1408
 { "a":  "null \u0000 escape" }
 
1409
(1 row)
 
1410
 
 
1411
select json '{ "a":  "null \\u0000 escape" }' as not_an_escape;
 
1412
          not_an_escape          
 
1413
---------------------------------
 
1414
 { "a":  "null \\u0000 escape" }
 
1415
(1 row)
 
1416
 
1401
1417
select json '{ "a":  "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
1402
 
ERROR:  invalid input syntax for type json
 
1418
ERROR:  unsupported Unicode escape sequence
1403
1419
DETAIL:  Unicode escape values cannot be used for code point values above 007F when the server encoding is not UTF8.
1404
1420
CONTEXT:  JSON data, line 1: { "a":...
1405
1421
select json '{ "a":  "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
1408
1424
 dollar $ character
1409
1425
(1 row)
1410
1426
 
1411
 
select json '{ "a":  "null \u0000 escape" }' ->> 'a' as not_unescaped;
1412
 
   not_unescaped    
 
1427
select json '{ "a":  "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
 
1428
      not_an_escape      
 
1429
-------------------------
 
1430
 dollar \u0024 character
 
1431
(1 row)
 
1432
 
 
1433
select json '{ "a":  "null \u0000 escape" }' ->> 'a' as fails;
 
1434
ERROR:  unsupported Unicode escape sequence
 
1435
DETAIL:  \u0000 cannot be converted to text.
 
1436
CONTEXT:  JSON data, line 1: { "a":...
 
1437
select json '{ "a":  "null \\u0000 escape" }' ->> 'a' as not_an_escape;
 
1438
   not_an_escape    
1413
1439
--------------------
1414
1440
 null \u0000 escape
1415
1441
(1 row)