~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-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
  • Date: 2016-02-11 15:44:43 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20160211154443-hmgw1nqsuckp5pa9
Tags: 9.3.11-0ubuntu0.14.04
* New upstream security/bug fix release: (LP: #1544576)
  - Fix infinite loops and buffer-overrun problems in regular expressions.
    Very large character ranges in bracket expressions could cause infinite
    loops in some cases, and memory overwrites in other cases.
    (CVE-2016-0773)
  - Prevent certain PL/Java parameters from being set by non-superusers.
    This change mitigates a PL/Java security bug (CVE-2016-0766), which was
    fixed in PL/Java by marking these parameters as superuser-only. To fix
    the security hazard for sites that update PostgreSQL more frequently
    than PL/Java, make the core code aware of them also.
  - See release notes for details about other fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
               ^
43
43
DETAIL:  Escape sequence "\v" is invalid.
44
44
CONTEXT:  JSON data, line 1: "\v...
45
 
SELECT '"\u"'::json;                    -- ERROR, incomplete escape
46
 
ERROR:  invalid input syntax for type json
47
 
LINE 1: SELECT '"\u"'::json;
48
 
               ^
49
 
DETAIL:  "\u" must be followed by four hexadecimal digits.
50
 
CONTEXT:  JSON data, line 1: "\u"
51
 
SELECT '"\u00"'::json;                  -- ERROR, incomplete escape
52
 
ERROR:  invalid input syntax for type json
53
 
LINE 1: SELECT '"\u00"'::json;
54
 
               ^
55
 
DETAIL:  "\u" must be followed by four hexadecimal digits.
56
 
CONTEXT:  JSON data, line 1: "\u00"
57
 
SELECT '"\u000g"'::json;                -- ERROR, g is not a hex digit
58
 
ERROR:  invalid input syntax for type json
59
 
LINE 1: SELECT '"\u000g"'::json;
60
 
               ^
61
 
DETAIL:  "\u" must be followed by four hexadecimal digits.
62
 
CONTEXT:  JSON data, line 1: "\u000g...
63
 
SELECT '"\u0000"'::json;                -- OK, legal escape
64
 
   json   
65
 
----------
66
 
 "\u0000"
67
 
(1 row)
68
 
 
69
 
SELECT '"\uaBcD"'::json;                -- OK, uppercase and lower case both OK
70
 
   json   
71
 
----------
72
 
 "\uaBcD"
73
 
(1 row)
74
 
 
 
45
-- see json_encoding test for input with unicode escapes
75
46
-- Numbers.
76
47
SELECT '1'::json;                               -- OK
77
48
 json 
936
907
ERROR:  cannot call json_populate_recordset on a nested object
937
908
select * from json_populate_recordset(row('def',99,null)::jpop,'[{"c":[100,200,300],"x":43.2},{"a":{"z":true},"b":3,"c":"2012-01-20 10:42:53"}]') q;
938
909
ERROR:  cannot call json_populate_recordset on a nested object
939
 
select json '{ "a":  "\ud83d\ude04\ud83d\udc36" }' -> 'a' as correct_in_utf8;
940
 
      correct_in_utf8       
941
 
----------------------------
942
 
 "\ud83d\ude04\ud83d\udc36"
943
 
(1 row)
944
 
 
945
 
select json '{ "a":  "\ud83d\ud83d" }' -> 'a'; -- 2 high surrogates in a row
946
 
ERROR:  invalid input syntax for type json
947
 
DETAIL:  Unicode high surrogate must not follow a high surrogate.
948
 
CONTEXT:  JSON data, line 1: { "a":...
949
 
select json '{ "a":  "\ude04\ud83d" }' -> 'a'; -- surrogates in wrong order
950
 
ERROR:  invalid input syntax for type json
951
 
DETAIL:  Unicode low surrogate must follow a high surrogate.
952
 
CONTEXT:  JSON data, line 1: { "a":...
953
 
select json '{ "a":  "\ud83dX" }' -> 'a'; -- orphan high surrogate
954
 
ERROR:  invalid input syntax for type json
955
 
DETAIL:  Unicode low surrogate must follow a high surrogate.
956
 
CONTEXT:  JSON data, line 1: { "a":...
957
 
select json '{ "a":  "\ude04X" }' -> 'a'; -- orphan low surrogate
958
 
ERROR:  invalid input syntax for type json
959
 
DETAIL:  Unicode low surrogate must follow a high surrogate.
960
 
CONTEXT:  JSON data, line 1: { "a":...
961
 
--handling of simple unicode escapes
962
 
select json '{ "a":  "the Copyright \u00a9 sign" }' ->> 'a' as correct_in_utf8;
963
 
   correct_in_utf8    
964
 
----------------------
965
 
 the Copyright © sign
966
 
(1 row)
967
 
 
968
 
select json '{ "a":  "dollar \u0024 character" }' ->> 'a' as correct_everywhere;
969
 
 correct_everywhere 
970
 
--------------------
971
 
 dollar $ character
972
 
(1 row)
973
 
 
974
 
select json '{ "a":  "null \u0000 escape" }' ->> 'a' as not_unescaped;
975
 
   not_unescaped    
976
 
--------------------
977
 
 null \u0000 escape
978
 
(1 row)
979