~helen-fornazier/shim/trunk

« back to all changes in this revision

Viewing changes to Cryptlib/OpenSSL/crypto/bio/bss_conn.c

  • Committer: Mathieu Trudel-Lapierre
  • Date: 2016-09-22 00:29:42 UTC
  • mto: This revision was merged to the branch mainline in revision 107.
  • Revision ID: mathieu.trudel-lapierre@canonical.com-20160922002942-volexao40gxxs0qs
Tags: upstream-0.9+1474479173.6c180c6
ImportĀ upstreamĀ versionĀ 0.9+1474479173.6c180c6

Show diffs side-by-side

added added

removed removed

Lines of Context:
419
419
{
420
420
    BIO *dbio;
421
421
    int *ip;
422
 
    const char **pptr;
 
422
    const char **pptr = NULL;
423
423
    long ret = 1;
424
424
    BIO_CONNECT *data;
425
425
 
442
442
    case BIO_C_GET_CONNECT:
443
443
        if (ptr != NULL) {
444
444
            pptr = (const char **)ptr;
445
 
            if (num == 0) {
446
 
                *pptr = data->param_hostname;
 
445
        }
447
446
 
448
 
            } else if (num == 1) {
449
 
                *pptr = data->param_port;
450
 
            } else if (num == 2) {
451
 
                *pptr = (char *)&(data->ip[0]);
452
 
            } else if (num == 3) {
453
 
                *((int *)ptr) = data->port;
454
 
            }
455
 
            if ((!b->init) || (ptr == NULL))
 
447
        if (b->init) {
 
448
            if (pptr != NULL) {
 
449
                ret = 1;
 
450
                if (num == 0) {
 
451
                    *pptr = data->param_hostname;
 
452
                } else if (num == 1) {
 
453
                    *pptr = data->param_port;
 
454
                } else if (num == 2) {
 
455
                    *pptr = (char *)&(data->ip[0]);
 
456
                } else {
 
457
                    ret = 0;
 
458
                }
 
459
            }
 
460
            if (num == 3) {
 
461
                ret = data->port;
 
462
            }
 
463
        } else {
 
464
            if (pptr != NULL)
456
465
                *pptr = "not initialized";
457
 
            ret = 1;
 
466
            ret = 0;
458
467
        }
459
468
        break;
460
469
    case BIO_C_SET_CONNECT: