tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hgo...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_map.c
Date Mon, 02 Jul 2001 21:13:43 GMT
hgomez      01/07/02 14:13:43

  Modified:    jk/native/common jk_map.c
  Log:
  Updated map, some checks added
  
  Revision  Changes    Path
  1.4       +6 -3      jakarta-tomcat-connectors/jk/native/common/jk_map.c
  
  Index: jk_map.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_map.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jk_map.c	2001/06/18 14:15:50	1.3
  +++ jk_map.c	2001/07/02 21:13:41	1.4
  @@ -58,7 +58,7 @@
   /***************************************************************************
    * Description: General purpose map object                                 *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.3 $                                           *
  + * Version:     $Revision: 1.4 $                                           *
    ***************************************************************************/
   
   #include "jk_global.h"
  @@ -416,8 +416,11 @@
           values = (void **)jk_pool_alloc(&m->p, sizeof(void *) * capacity);
           
           if(values && names) {
  -            memcpy(names, m->names, sizeof(char *) * m->capacity);
  -            memcpy(values, m->values, sizeof(void *) * m->capacity);
  +            if (m->capacity && m->names) 
  +                memcpy(names, m->names, sizeof(char *) * m->capacity);
  +
  +            if (m->capacity && m->values)
  +                memcpy(values, m->values, sizeof(void *) * m->capacity);
   
               m->names = names;
               m->values = values;
  
  
  

Mime
View raw message