~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-security

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2015-10-08 15:42:16 UTC
  • mfrom: (1.2.3) (18.1.3 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20151008154216-zvhdaqznz9qf4rw2
Tags: 9.3.10-0ubuntu0.14.04
* New upstream security/bug fix release: (LP: #1504132)
  - Guard against stack overflows in json parsing.
    If an application constructs PostgreSQL json or jsonb values from
    arbitrary user input, the application's users can reliably crash the
    PostgreSQL server, causing momentary denial of service.  (CVE-2015-5289)

  - Fix contrib/pgcrypto to detect and report too-short crypt() salts
    Certain invalid salt arguments crashed the server or disclosed a few
    bytes of server memory.  We have not ruled out the viability of attacks
    that arrange for presence of confidential information in the disclosed
    bytes, but they seem unlikely.  (CVE-2015-5288)

  - See release notes for details about other fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
599
599
(1 row)
600
600
 
601
601
abort;
 
602
-- Test for proper cleanup after a failure in a cursor portal
 
603
-- that was created in an outer subtransaction
 
604
CREATE FUNCTION invert(x float8) RETURNS float8 LANGUAGE plpgsql AS
 
605
$$ begin return 1/x; end $$;
 
606
CREATE FUNCTION create_temp_tab() RETURNS text
 
607
LANGUAGE plpgsql AS $$
 
608
BEGIN
 
609
  CREATE TEMP TABLE new_table (f1 float8);
 
610
  -- case of interest is that we fail while holding an open
 
611
  -- relcache reference to new_table
 
612
  INSERT INTO new_table SELECT invert(0.0);
 
613
  RETURN 'foo';
 
614
END $$;
 
615
BEGIN;
 
616
DECLARE ok CURSOR FOR SELECT * FROM int8_tbl;
 
617
DECLARE ctt CURSOR FOR SELECT create_temp_tab();
 
618
FETCH ok;
 
619
 q1  | q2  
 
620
-----+-----
 
621
 123 | 456
 
622
(1 row)
 
623
 
 
624
SAVEPOINT s1;
 
625
FETCH ok;  -- should work
 
626
 q1  |        q2        
 
627
-----+------------------
 
628
 123 | 4567890123456789
 
629
(1 row)
 
630
 
 
631
FETCH ctt; -- error occurs here
 
632
ERROR:  division by zero
 
633
CONTEXT:  PL/pgSQL function invert(double precision) line 1 at RETURN
 
634
SQL statement "INSERT INTO new_table SELECT invert(0.0)"
 
635
PL/pgSQL function create_temp_tab() line 6 at SQL statement
 
636
ROLLBACK TO s1;
 
637
FETCH ok;  -- should work
 
638
        q1        | q2  
 
639
------------------+-----
 
640
 4567890123456789 | 123
 
641
(1 row)
 
642
 
 
643
FETCH ctt; -- must be rejected
 
644
ERROR:  portal "ctt" cannot be run
 
645
COMMIT;
 
646
DROP FUNCTION create_temp_tab();
 
647
DROP FUNCTION invert(x float8);
602
648
-- Test for successful cleanup of an aborted transaction at session exit.
603
649
-- THIS MUST BE THE LAST TEST IN THIS FILE.
604
650
begin;