[EMAIL PROTECTED] wrote:
gregames 2003/03/27 12:34:56

Modified: server protocol.c
Log:
ap_rgetline_core: set the number of bytes read & copied into the caller's
buffer when returning APR_ENOSPC. This prevents seg faults in
ap_get_mime_headers_core in an error path which handles headers that are too
long.
Submitted by: Jeff Trawick
unclear; see below :)

  @@ -390,6 +391,7 @@
               last_char = *s + bytes_handled - 1;
           }
           else {
  +            *read = n;

I thought this should be


*read = bytes_handled;

since bytes_handled tells how many bytes were successfully copied to the caller's buffer, whereas n just tells how big the callers buffer is
(or am I confused???)


               return APR_ENOSPC;
           }
       }
  @@ -519,6 +521,7 @@
                   return APR_SUCCESS;
               }
               else {
  +                *read = n;
same comment as above
                   return APR_ENOSPC;
               }
           }



Reply via email to