2 - use a sensibly % 64 sized buffer
3 - cope with short reads properly
4 - remove redundant variable
6 --- httpd-2.0.46/server/util_md5.c.md5dig
7 +++ httpd-2.0.46/server/util_md5.c
9 AP_DECLARE(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile)
11 apr_md5_ctx_t context;
12 - unsigned char buf[1000];
15 + unsigned char buf[4096];
16 + apr_size_t nbytes = sizeof buf;
17 apr_off_t offset = 0L;
19 apr_md5_init(&context);
20 - nbytes = sizeof(buf);
21 while (apr_file_read(infile, buf, &nbytes) == APR_SUCCESS) {
23 apr_md5_update(&context, buf, nbytes);
24 + nbytes = sizeof(buf);
26 apr_file_seek(infile, APR_SET, &offset);
27 return ap_md5contextTo64(p, &context);