~ubuntu-branches/ubuntu/natty/gnutls26/natty-updates

« back to all changes in this revision

Viewing changes to lib/minitasn1/element.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2008-07-01 20:31:24 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080701203124-6zu0d7gash9604z1
Tags: 2.4.2-1
* New upstream bugfix release.
* Up to date gnutls-cli manpage. Closes: #492775

Show diffs side-by-side

added added

removed removed

Lines of Context:
420
420
      asn1_length_der (len - k, NULL, &len2);
421
421
      temp = (unsigned char *) _asn1_malloc (len - k + len2);
422
422
      if (temp == NULL)
423
 
        return ASN1_MEM_ALLOC_ERROR;
 
423
        {
 
424
          _asn1_free (value_temp);
 
425
          return ASN1_MEM_ALLOC_ERROR;
 
426
        }
424
427
 
425
428
      asn1_octet_der (value_temp + k, len - k, temp, &len2);
426
429
      _asn1_set_value (node, temp, len2);
438
441
              default_temp =
439
442
                (unsigned char *) _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
440
443
              if (default_temp == NULL)
441
 
                return ASN1_MEM_ALLOC_ERROR;
 
444
                {
 
445
                  _asn1_free (value_temp);
 
446
                  return ASN1_MEM_ALLOC_ERROR;
 
447
                }
442
448
 
443
449
              _asn1_convert_integer (p->value, default_temp,
444
450
                                     SIZEOF_UNSIGNED_LONG_INT, &len2);
446
452
          else
447
453
            {                   /* is an identifier like v1 */
448
454
              if (!(node->type & CONST_LIST))
449
 
                return ASN1_VALUE_NOT_VALID;
 
455
                {
 
456
                  _asn1_free (value_temp);
 
457
                  return ASN1_VALUE_NOT_VALID;
 
458
                }
450
459
              p2 = node->down;
451
460
              while (p2)
452
461
                {
458
467
                            (unsigned char *)
459
468
                            _asn1_malloc (SIZEOF_UNSIGNED_LONG_INT);
460
469
                          if (default_temp == NULL)
461
 
                            return ASN1_MEM_ALLOC_ERROR;
 
470
                            {
 
471
                              _asn1_free (value_temp);
 
472
                              return ASN1_MEM_ALLOC_ERROR;
 
473
                            }
462
474
 
463
475
                          _asn1_convert_integer (p2->value,
464
476
                                                 default_temp,
470
482
                  p2 = p2->right;
471
483
                }
472
484
              if (p2 == NULL)
473
 
                return ASN1_VALUE_NOT_VALID;
 
485
                {
 
486
                  _asn1_free (value_temp);
 
487
                  return ASN1_VALUE_NOT_VALID;
 
488
                }
474
489
            }
475
490
 
476
491