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

« back to all changes in this revision

Viewing changes to src/test/regress/expected/json.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,
1400
1386
DETAIL:  Unicode low surrogate must follow a high surrogate.
1401
1387
CONTEXT:  JSON data, line 1: { "a":...
1402
1388
--handling of simple unicode escapes
 
1389
select json '{ "a":  "the Copyright \u00a9 sign" }' as correct_in_utf8;
 
1390
            correct_in_utf8            
 
1391
---------------------------------------
 
1392
 { "a":  "the Copyright \u00a9 sign" }
 
1393
(1 row)
 
1394
 
 
1395
select json '{ "a":  "dollar \u0024 character" }' as correct_everywhere;
 
1396
         correct_everywhere          
 
1397
-------------------------------------
 
1398
 { "a":  "dollar \u0024 character" }
 
1399
(1 row)
 
1400
 
 
1401
select json '{ "a":  "dollar \\u0024 character" }' as not_an_escape;
 
1402
            not_an_escape             
 
1403
--------------------------------------
 
1404
 { "a":  "dollar \\u0024 character" }
 
1405
(1 row)
 
1406
 
 
1407
select json '{ "a":  "null \u0000 escape" }' as not_unescaped;
 
1408
         not_unescaped          
 
1409
--------------------------------
 
1410
 { "a":  "null \u0000 escape" }
 
1411
(1 row)
 
1412
 
 
1413
select json '{ "a":  "null \\u0000 escape" }' as not_an_escape;
 
1414
          not_an_escape          
 
1415
---------------------------------
 
1416
 { "a":  "null \\u0000 escape" }
 
1417
(1 row)
 
1418
 
1403
1419
select json '{ "a":  "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
1404
1420
   correct_in_utf8    
1405
1421
----------------------
1412
1428
 dollar $ character
1413
1429
(1 row)
1414
1430
 
1415
 
select json '{ "a":  "null \u0000 escape" }' ->> 'a' as not_unescaped;
1416
 
   not_unescaped    
 
1431
select json '{ "a":  "dollar \\u0024 character" }' ->> 'a' as not_an_escape;
 
1432
      not_an_escape      
 
1433
-------------------------
 
1434
 dollar \u0024 character
 
1435
(1 row)
 
1436
 
 
1437
select json '{ "a":  "null \u0000 escape" }' ->> 'a' as fails;
 
1438
ERROR:  unsupported Unicode escape sequence
 
1439
DETAIL:  \u0000 cannot be converted to text.
 
1440
CONTEXT:  JSON data, line 1: { "a":...
 
1441
select json '{ "a":  "null \\u0000 escape" }' ->> 'a' as not_an_escape;
 
1442
   not_an_escape    
1417
1443
--------------------
1418
1444
 null \u0000 escape
1419
1445
(1 row)