~ubuntu-branches/ubuntu/raring/nss/raring-security

« back to all changes in this revision

Viewing changes to mozilla/security/nss/cmd/sdrtest/sdrtest.c

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2010-03-25 13:46:06 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100325134606-bl6liuok2w9l7snv
Tags: 3.12.6-0ubuntu1
* New upstream release 3.12.6 RTM (NSS_3_12_6_RTM)
  - fixes CVE-2009-3555 aka US-CERT VU#120541
* Adjust patches to changed upstream code base
  - update debian/patches/38_kbsd.patch
  - update debian/patches/38_mips64_build.patch
  - update debian/patches/85_security_load.patch
* Remove patches that are merged upstream
  - delete debian/patches/91_nonexec_stack.patch
  - update debian/patches/series
* Bump nspr dependency to 4.8
  - update debian/control
* Add new symbols for 3.12.6
  - update debian/libnss3-1d.symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
/*
38
38
 * Test program for SDR (Secret Decoder Ring) functions.
39
39
 *
40
 
 * $Id: sdrtest.c,v 1.14 2008/03/10 20:16:44 rrelyea%redhat.com Exp $
 
40
 * $Id: sdrtest.c,v 1.16 2009/07/08 21:37:43 julien.pierre.boogz%sun.com Exp $
41
41
 */
42
42
 
43
43
#include "nspr.h"
113
113
  result->data = NULL;
114
114
  do {
115
115
    if (bufsize < wanted) {
116
 
      unsigned char * tmpData = (unsigned char *)realloc(result->data, wanted);
 
116
      unsigned char * tmpData = (unsigned char *)PR_Realloc(result->data, wanted);
117
117
      if (!tmpData) {
118
118
        if (verbose) PR_fprintf(pr_stderr, "Allocation of buffer failed\n");
119
119
        return -1;
153
153
  }
154
154
 
155
155
  result->len = info.size;
156
 
  result->data = (unsigned char *)malloc(result->len);
 
156
  result->data = (unsigned char *)PR_Malloc(result->len);
157
157
  if (!result->data) {
158
158
    if (verbose) PR_fprintf(pr_stderr, "Allocation of buffer failed\n");
159
159
    goto file_loser;
313
313
          retval = -1;
314
314
          goto loser;
315
315
        }
316
 
        free(result.data);
 
316
        SECITEM_ZfreeItem(&result, PR_FALSE);
317
317
        result = *ok;
318
318
      }
319
319
    }
436
436
    }
437
437
 
438
438
loser:
439
 
    if (text.data) free(text.data);
440
 
    if (result.data) free(result.data);
 
439
    if (text.data) SECITEM_ZfreeItem(&text, PR_FALSE);
 
440
    if (result.data) SECITEM_ZfreeItem(&result, PR_FALSE);
441
441
    if (NSS_Shutdown() != SECSuccess) {
442
442
       exit(1);
443
443
    }