This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 5a2e706b92 Fix logic bug spotted by Coverity Scan
5a2e706b92 is described below
commit 5a2e706b92aa0921268fee9f1b0bdf9b38ebfe62
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Jan 15 10:11:59 2024 +0000
Fix logic bug spotted by Coverity Scan
---
.../tomcat/util/digester/ServiceBindingPropertySource.java | 2 +-
webapps/docs/changelog.xml | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git
a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
index a96e5d8285..997ce354db 100644
--- a/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
+++ b/java/org/apache/tomcat/util/digester/ServiceBindingPropertySource.java
@@ -139,7 +139,7 @@ public class ServiceBindingPropertySource implements
IntrospectionUtils.SecurePr
int length = bytes.length;
if (chomp) {
- if(length > 1 && bytes[length - 2] == '\r' && bytes[length -
2] == '\n') {
+ if(length > 1 && bytes[length - 2] == '\r' && bytes[length -
1] == '\n') {
length -= 2;
} else if (length > 0) {
byte c = bytes[length - 1];
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0a27c6b585..58b47a91fe 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,15 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 8.5.99 (schultz)" rtext="in development">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ Fix ServiceBindingPropertySource so that trailing <code>\r\n</code>
+ sequences are correctly removed from files containing property values
+ when configured to do so. Bug identified by Coverity Scan. (markt)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="Tomcat 8.5.98 (schultz)" rtext="2024-01-09">
<subsection name="Catalina">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]