This patch fixes a buffer overrun problem in mod_cookies. It's a security hole and considered to have the potential to be quite serious. This patch will bring it up to equivalence with Apache 1.1.3. *** mod_cookies.c.orig Mon Jan 13 20:45:05 1997 --- mod_cookies.c Mon Jan 13 20:43:54 1997 *************** *** 1,6 **** /* ==================================================================== ! * Copyright (c) 1995, 1996 The Apache Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions --- 1,6 ---- /* ==================================================================== ! * Copyright (c) 1995-1997 The Apache Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions *************** *** 119,133 **** void make_cookie(request_rec *r) { struct timeval tv; ! char new_cookie[100]; /* blurgh */ char *dot; ! const char *rname = pstrdup(r->pool, get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)); struct timezone tz = { 0 , 0 }; if ((dot = strchr(rname,'.'))) *dot='\0'; /* First bit of hostname */ gettimeofday(&tv, &tz); sprintf(new_cookie,"%s%s%d%ld%d; path=/", COOKIE_NAME, rname, --- 119,136 ---- void make_cookie(request_rec *r) { struct timeval tv; ! char new_cookie[1024]; /* blurgh */ char *dot; ! char *rname = pstrdup(r->pool, get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)); struct timezone tz = { 0 , 0 }; if ((dot = strchr(rname,'.'))) *dot='\0'; /* First bit of hostname */ + if (strlen (rname) > 255) + rname[256] = 0; + gettimeofday(&tv, &tz); sprintf(new_cookie,"%s%s%d%ld%d; path=/", COOKIE_NAME, rname,