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

« back to all changes in this revision

Viewing changes to src/interfaces/libpq/fe-print.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:
681
681
        int                     i,
682
682
                                j;
683
683
        char            formatString[80];
684
 
 
685
684
        char       *tborder = NULL;
686
685
 
687
686
        nFields = PQnfields(res);
700
699
                        int                     width;
701
700
 
702
701
                        width = nFields * 14;
703
 
                        tborder = malloc(width + 1);
 
702
                        tborder = (char *) malloc(width + 1);
704
703
                        if (!tborder)
705
704
                        {
706
705
                                fprintf(stderr, libpq_gettext("out of memory\n"));
707
706
                                exit(1);
708
707
                        }
709
 
                        for (i = 0; i <= width; i++)
 
708
                        for (i = 0; i < width; i++)
710
709
                                tborder[i] = '-';
711
 
                        tborder[i] = '\0';
 
710
                        tborder[width] = '\0';
712
711
                        fprintf(fout, "%s\n", tborder);
713
712
                }
714
713