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

« back to all changes in this revision

Viewing changes to src/backend/access/gin/ginscan.c

  • 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:
163
163
        key->curItemMatches = false;
164
164
        key->recheckCurItem = false;
165
165
        key->isFinished = false;
 
166
        key->nrequired = 0;
 
167
        key->nadditional = 0;
 
168
        key->requiredEntries = NULL;
 
169
        key->additionalEntries = NULL;
166
170
 
167
171
        ginInitConsistentFunction(ginstate, key);
168
172
 
223
227
        }
224
228
}
225
229
 
226
 
static void
227
 
freeScanKeys(GinScanOpaque so)
 
230
void
 
231
ginFreeScanKeys(GinScanOpaque so)
228
232
{
229
233
        uint32          i;
230
234
 
237
241
 
238
242
                pfree(key->scanEntry);
239
243
                pfree(key->entryRes);
 
244
                if (key->requiredEntries)
 
245
                        pfree(key->requiredEntries);
 
246
                if (key->additionalEntries)
 
247
                        pfree(key->additionalEntries);
240
248
        }
241
249
 
242
250
        pfree(so->keys);
416
424
        /* remaining arguments are ignored */
417
425
        GinScanOpaque so = (GinScanOpaque) scan->opaque;
418
426
 
419
 
        freeScanKeys(so);
 
427
        ginFreeScanKeys(so);
420
428
 
421
429
        if (scankey && scan->numberOfKeys > 0)
422
430
        {
434
442
        IndexScanDesc scan = (IndexScanDesc) PG_GETARG_POINTER(0);
435
443
        GinScanOpaque so = (GinScanOpaque) scan->opaque;
436
444
 
437
 
        freeScanKeys(so);
 
445
        ginFreeScanKeys(so);
438
446
 
439
447
        MemoryContextDelete(so->tempCtx);
440
448