| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | #include <stdio.h> | - |
| 11 | #include "internal/cryptlib.h" | - |
| 12 | #include <openssl/asn1.h> | - |
| 13 | | - |
| 14 | #ifndef NO_OLD_ASN1 | - |
| 15 | | - |
| 16 | void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x) | - |
| 17 | { | - |
| 18 | unsigned char *b, *p; | - |
| 19 | const unsigned char *p2; | - |
| 20 | int i; | - |
| 21 | char *ret; | - |
| 22 | | - |
| 23 | if (x == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 24 | return NULL; never executed: return ((void *)0) ; | 0 |
| 25 | | - |
| 26 | i = i2d(x, NULL); | - |
| 27 | b = OPENSSL_malloc(i + 10); | - |
| 28 | if (b == NULL) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 29 | ASN1err(ASN1_F_ASN1_DUP, ERR_R_MALLOC_FAILURE); | - |
| 30 | return NULL; never executed: return ((void *)0) ; | 0 |
| 31 | } | - |
| 32 | p = b; | - |
| 33 | i = i2d(x, &p); | - |
| 34 | p2 = b; | - |
| 35 | ret = d2i(NULL, &p2, i); | - |
| 36 | OPENSSL_free(b); | - |
| 37 | return ret; never executed: return ret; | 0 |
| 38 | } | - |
| 39 | | - |
| 40 | #endif | - |
| 41 | | - |
| 42 | | - |
| 43 | | - |
| 44 | | - |
| 45 | | - |
| 46 | | - |
| 47 | | - |
| 48 | | - |
| 49 | void *ASN1_item_dup(const ASN1_ITEM *it, void *x) | - |
| 50 | { | - |
| 51 | unsigned char *b = NULL; | - |
| 52 | const unsigned char *p; | - |
| 53 | long i; | - |
| 54 | void *ret; | - |
| 55 | | - |
| 56 | if (x == NULL)| TRUE | never evaluated | | FALSE | evaluated 27082 times by 1 test |
| 0-27082 |
| 57 | return NULL; never executed: return ((void *)0) ; | 0 |
| 58 | | - |
| 59 | i = ASN1_item_i2d(x, &b, it); | - |
| 60 | if (b == NULL) {| TRUE | never evaluated | | FALSE | evaluated 27082 times by 1 test |
| 0-27082 |
| 61 | ASN1err(ASN1_F_ASN1_ITEM_DUP, ERR_R_MALLOC_FAILURE); | - |
| 62 | return NULL; never executed: return ((void *)0) ; | 0 |
| 63 | } | - |
| 64 | p = b; | - |
| 65 | ret = ASN1_item_d2i(NULL, &p, i, it); | - |
| 66 | OPENSSL_free(b); | - |
| 67 | return ret;executed 27082 times by 1 test: return ret; | 27082 |
| 68 | } | - |
| | |