~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/backend/parser/parse_expr.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-02-05 18:13:52 UTC
  • mfrom: (1.1.10) (10.1.5 oneiric-proposed)
  • Revision ID: package-import@ubuntu.com-20130205181352-3kw4f94ilqklzm7c
Tags: 9.1.8-0ubuntu11.10
* New upstream security/bug fix release: (LP: #1116336)
  - Prevent execution of enum_recv from SQL
    The function was misdeclared, allowing a simple SQL command to crash the
    server.  In principle an attacker might be able to use it to examine the
    contents of server memory.  Our thanks to Sumit Soni (via Secunia SVCRP)
    for reporting this issue. (CVE-2013-0255)
  - See HISTORY/changelog.gz for the other bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
 *      function argument to the required type (via coerce_type())
92
92
 *      can apply transformExpr to an already-transformed subexpression.
93
93
 *      An example here is "SELECT count(*) + 1.0 FROM table".
 
94
 *      3. CREATE TABLE t1 (LIKE t2 INCLUDING INDEXES) can pass in
 
95
 *      already-transformed index expressions.
94
96
 * While it might be possible to eliminate these cases, the path of
95
97
 * least resistance so far has been to ensure that transformExpr() does
96
98
 * no damage if applied to an already-transformed tree.  This is pretty
1691
1693
static Node *
1692
1694
transformRowExpr(ParseState *pstate, RowExpr *r)
1693
1695
{
1694
 
        RowExpr    *newr = makeNode(RowExpr);
 
1696
        RowExpr    *newr;
 
1697
 
 
1698
        /* If we already transformed this node, do nothing */
 
1699
        if (OidIsValid(r->row_typeid))
 
1700
                return (Node *) r;
 
1701
 
 
1702
        newr = makeNode(RowExpr);
1695
1703
 
1696
1704
        /* Transform the field expressions */
1697
1705
        newr->args = transformExpressionList(pstate, r->args);
1784
1792
static Node *
1785
1793
transformXmlExpr(ParseState *pstate, XmlExpr *x)
1786
1794
{
1787
 
        XmlExpr    *newx = makeNode(XmlExpr);
 
1795
        XmlExpr    *newx;
1788
1796
        ListCell   *lc;
1789
1797
        int                     i;
1790
1798
 
 
1799
        /* If we already transformed this node, do nothing */
 
1800
        if (OidIsValid(x->type))
 
1801
                return (Node *) x;
 
1802
 
 
1803
        newx = makeNode(XmlExpr);
1791
1804
        newx->op = x->op;
1792
1805
        if (x->name)
1793
1806
                newx->name = map_sql_identifier_to_xml_name(x->name, false, false);
1794
1807
        else
1795
1808
                newx->name = NULL;
1796
1809
        newx->xmloption = x->xmloption;
 
1810
        newx->type = XMLOID;            /* this just marks the node as transformed */
 
1811
        newx->typmod = -1;
1797
1812
        newx->location = x->location;
1798
1813
 
1799
1814
        /*