]> granicus.if.org Git - apache/commitdiff
Fix a SIGSEGV in ap_md5digest() (bad parms to ap_seek()). This is used
authorJeff Trawick <trawick@apache.org>
Thu, 1 Jun 2000 22:52:50 +0000 (22:52 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 1 Jun 2000 22:52:50 +0000 (22:52 +0000)
when you have ContentDigest enabled and we can't/don't mmap the file.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85373 13f79535-47bb-0310-9956-ffa450edef68

server/util_md5.c

index 1f06ba6f68cac15ee28d3c6548ed84666298b5fa..12f103827b8ed4d00146f71fae0a40364faef4f0 100644 (file)
@@ -203,6 +203,7 @@ API_EXPORT(char *) ap_md5digest(ap_pool_t *p, ap_file_t *infile,
     unsigned char buf[1000];
     long length = 0;
     int nbytes;
+    ap_off_t offset = 0L;
 
     ap_MD5Init(&context);
     if (xlate) {
@@ -213,7 +214,7 @@ API_EXPORT(char *) ap_md5digest(ap_pool_t *p, ap_file_t *infile,
        length += nbytes;
        ap_MD5Update(&context, buf, nbytes);
     }
-    ap_seek(infile, 0L, APR_SET);
+    ap_seek(infile, APR_SET, &offset);
     return ap_md5contextTo64(p, &context);
 }
 
@@ -225,6 +226,7 @@ API_EXPORT(char *) ap_md5digest(ap_pool_t *p, ap_file_t *infile)
     unsigned char buf[1000];
     long length = 0;
     ap_ssize_t nbytes;
+    ap_off_t offset = 0L;
 
     ap_MD5Init(&context);
     nbytes = sizeof(buf);
@@ -232,7 +234,7 @@ API_EXPORT(char *) ap_md5digest(ap_pool_t *p, ap_file_t *infile)
        length += nbytes;
        ap_MD5Update(&context, buf, nbytes);
     }
-    ap_seek(infile, 0L, APR_SET);
+    ap_seek(infile, APR_SET, &offset);
     return ap_md5contextTo64(p, &context);
 }