When a 'read' or 'write' to session cache is done, we need to check the size
of the data being 'read' or 'written' to avoid buffer over-run.
PR: 27751
Submitted by: Geoff Thorpe
Reviewed by: Madhusudan Mathihalli
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103669
13f79535-47bb-0310-9956-
ffa450edef68
[Remove entries to the current 2.0 section below, when backported]
+ *) Fix a potential SEGV in the 'shmcb' session cache when session data
+ size is greater than the size of the cache. PR 27751
+ [Geoff Thorpe <geoff geoffthorpe.net>]
+
*) Proxy server was deleting cookies that Apache had already
assigned if the origin server had set any cookies. PR 27023.
[Jim Jagielski]
unsigned int dest_offset,
unsigned char *src, unsigned int src_len)
{
+ /* Cover the case that src_len > buf_size */
+ if (src_len > buf_size)
+ src_len = buf_size;
+
/* Can it be copied all in one go? */
if (dest_offset + src_len < buf_size)
/* yes */
unsigned int src_offset,
unsigned int src_len)
{
+ /* Cover the case that src_len > buf_size */
+ if (src_len > buf_size)
+ src_len = buf_size;
+
/* Can it be copied all in one go? */
if (src_offset + src_len < buf_size)
/* yes */