dgaudet 98/02/20 11:21:24
Modified: src CHANGES
src/ap ap_cpystrn.c
Log:
fix off-by-1 error in ap_cpystrn
PR: 1847
Submitted by: Charles Fu <[EMAIL PROTECTED]>
Revision Changes Path
1.643 +11 -8 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.642
retrieving revision 1.643
diff -u -r1.642 -r1.643
--- CHANGES 1998/02/20 10:51:30 1.642
+++ CHANGES 1998/02/20 19:21:20 1.643
@@ -1,15 +1,18 @@
Changes with Apache 1.3b6
- *) As Ken suggested the check_cmd_context() function and related defines
- are non-static now so modules can use 'em. [Martin Kraemer]
+ *) ap_cpystrn() had an off-by-1 error.
+ [Charles Fu <[EMAIL PROTECTED]>] PR#1847
- *) mod_info would occasionally produce an unpaired <tt> in its
- output. Fixed. [Martin Kraemer]
+ *) As Ken suggested the check_cmd_context() function and related defines
+ are non-static now so modules can use 'em. [Martin Kraemer]
- *) By default AIX binds a process (and it's children) to a single
- processor. httpd children now unbind themselves from that cpu
- and re-bind to one selected at random via bindprocessor()
- [Doug MacEachern]
+ *) mod_info would occasionally produce an unpaired <tt> in its
+ output. Fixed. [Martin Kraemer]
+
+ *) By default AIX binds a process (and it's children) to a single
+ processor. httpd children now unbind themselves from that cpu
+ and re-bind to one selected at random via bindprocessor()
+ [Doug MacEachern]
*) Linux 2.0 and above implement RLIMIT_AS, RLIMIT_DATA has almost no
effect. Work around it by using RLIMIT_AS for the RLimitMEM
1.4 +5 -2 apache-1.3/src/ap/ap_cpystrn.c
Index: ap_cpystrn.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/ap/ap_cpystrn.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ap_cpystrn.c 1998/01/07 16:45:55 1.3
+++ ap_cpystrn.c 1998/02/20 19:21:24 1.4
@@ -77,8 +77,11 @@
d = dst;
end = dst + dst_size - 1;
- while ((d < end) && (*d++ = *src++))
- ; /* nop, the while does it all */
+ for (; d < end; ++d, ++src) {
+ if (!(*d = *src)) {
+ return (d);
+ }
+ }
*d = '\0'; /* always null terminate */