At 17:52 07.06.99 +0200, you wrote:
>Hallo,
>
>I think in b_sock.c I've stumbled into some error cases in which some locking
>isn't undone:

sorry, wrong diff...

*** OpenSSL/crypto/bio/b_sock.c Mon Apr 26 19:00:12 1999
--- OpenSSL/crypto/bio/b_sock.fixed.c   Mon Jun  7 17:46:45 1999
***************
*** 247,253 ****
  
        MemCheck_off();
        ret=(struct hostent *)Malloc(sizeof(struct hostent));
!       if (ret == NULL) return(NULL);
        memset(ret,0,sizeof(struct hostent));
  
        for (i=0; a->h_aliases[i] != NULL; i++)
--- 247,254 ----
  
        MemCheck_off();
        ret=(struct hostent *)Malloc(sizeof(struct hostent));
!       if (ret == NULL)
!               goto err;
        memset(ret,0,sizeof(struct hostent));
  
        for (i=0; a->h_aliases[i] != NULL; i++)
***************
*** 349,356 ****
                BIO_ghbn_miss++;
                ret=gethostbyname(name);
  
!               if (ret == NULL) return(NULL);
!               if (j > 128) return(ret); /* too big to cache */
  
                /* else add to cache */
                if (ghbn_cache[lowi].ent != NULL)
--- 350,360 ----
                BIO_ghbn_miss++;
                ret=gethostbyname(name);
  
!               if (ret == NULL || j > 128) /* not found or too big to
cache */
!                       {
!                       CRYPTO_w_unlock(CRYPTO_LOCK_BIO_GETHOSTBYNAME);
!                       return(ret);
!                       }
  
                /* else add to cache */
                if (ghbn_cache[lowi].ent != NULL)

By

Goetz

-- 
Goetz Babin-Ebell                      mailto:[EMAIL PROTECTED]
TC Trust Center for Security           http://www.trustcenter.de
in Data Networks GmbH                  Tel.: +49-40-766 29 3301
Am Werder 1 / 21073 Hamburg / Germany  Fax.: +49-40-766 29 577
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to