On Fri, 21 Jul 2000, Richard Levitte - VMS Whacker wrote:

> My answer bounced on the address "[EMAIL PROTECTED]".  Looking back, I
> saw that all the other recipients at Trend have their full name as
> username, so I'm trying "[EMAIL PROTECTED]".  If this reaches
> you, you should really change your From: och Reply-To: to the correct
> address, or is that some kind of spam filtering trick?

Dear Richard,

Sorry for the incorrect address in "From:" field. However, there should be
a "Reply-to" field in the header of my mail. It should be filtered by the
mailing list system. :(  But you are so smart to catch my correct address.
Besides, please forgive me that forgot to attach the patch file in the
previous mail. Here it is.

I have checked crypto/mem_dbg.c to find out the "normal" solution in
openssl. I say "normal" because our patch is only for our case (linux
platform and pthread supported). We add a pthread mutex to protect the
variable. However, it is not portable.
Thank you for your response and we will try to fix it with the "normal"
way used in openssl (MemCheck_on and MemCheck_of). However, I don't know
if there is any hidden dead-lock problem. But we will modify and propose
our patch later.

Thank you.
*** openssl-0.9.5a/crypto/objects/o_names.c     Tue Mar 14 07:54:32 2000
--- openssl-0.9.5a-patch/crypto/objects/o_names.c       Thu Jul 20 11:04:41 2000
***************
*** 5,16 ****
--- 5,18 ----
  #include <openssl/lhash.h>
  #include <openssl/objects.h>
  #include <openssl/safestack.h>
+ #include <pthread.h>
  
  /* I use the ex_data stuff to manage the identifiers for the obj_name_types
   * that applications may define.  I only really use the free function field.
   */
  static LHASH *names_lh=NULL;
  static int names_type_num=OBJ_NAME_TYPE_NUM;
+ static pthread_mutex_t lh_mutex = PTHREAD_MUTEX_INITIALIZER;
  
  typedef struct name_funcs_st
        {
***************
*** 132,138 ****
--- 134,142 ----
  
        for (;;)
                {
+               pthread_mutex_lock(&lh_mutex);
                ret=(OBJ_NAME *)lh_retrieve(names_lh,&on);
+               pthread_mutex_unlock(&lh_mutex);
                if (ret == NULL) return(NULL);
                if ((ret->alias) && !alias)
                        {
***************
*** 168,174 ****
--- 172,181 ----
        onp->type=type;
        onp->data=data;
  
+       pthread_mutex_lock(&lh_mutex);
        ret=(OBJ_NAME *)lh_insert(names_lh,onp);
+       pthread_mutex_unlock(&lh_mutex);
+ 
        if (ret != NULL)
                {
                /* free things */
***************
*** 203,209 ****
--- 210,218 ----
        type&= ~OBJ_NAME_ALIAS;
        on.name=name;
        on.type=type;
+       pthread_mutex_lock(&lh_mutex);
        ret=(OBJ_NAME *)lh_delete(names_lh,&on);
+       pthread_mutex_unlock(&lh_mutex);
        if (ret != NULL)
                {
                /* free things */

Reply via email to