tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/native/apache/jserv jserv_balance.c
Date Tue, 04 Apr 2000 19:14:08 GMT
jluc        00/04/04 12:14:08

  Modified:    src/native/apache/jserv jserv_balance.c
  Log:
  potential buffer overflow fix.
  
  Revision  Changes    Path
  1.5       +7 -3      jakarta-tomcat/src/native/apache/jserv/jserv_balance.c
  
  Index: jserv_balance.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/native/apache/jserv/jserv_balance.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- jserv_balance.c	2000/03/30 09:26:57	1.4
  +++ jserv_balance.c	2000/04/04 19:14:08	1.5
  @@ -54,7 +54,7 @@
    * Author:      Bernard Bernstein <bernard@corp.talkcity.com>                *
    * Updated:     March 1999 Jean-Luc Rochat <jlrochat@jnix.com>               *
    * Description: solved part of fail-over problems & LB improvments           *
  - * Version:     $Revision: 1.4 $                                             *
  + * Version:     $Revision: 1.5 $
    *****************************************************************************/
   
   #include "jserv.h"
  @@ -154,8 +154,12 @@
     char sessionid[256];
   
    /* first JServ 1.1 as it is the production one */
  -  strcpy(sessionid, SESSION_IDENTIFIER_JSERV);
  -  strcat(sessionid, zone);
  +  strcpy(sessionid, SESSION_IDENTIFIER_JSERV, sizeof(sessionid)-1);
  + /* as our strings are defined here we know they are < 256 bytes  */
  + /* we check the routing info length */
  +  if (strlen(zone) < sizeof(sessionid)-strlen(sessionid)) 
  +      strcat(sessionid, zone);
  +  
     val = get_param(sessionid, r);
   
     if (val == NULL) {
  
  
  

Mime
View raw message