This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 2f791cfeae Fix logic bug spotted by Coverity Scan
2f791cfeae is described below
commit 2f791cfeae3178ad786118862df1af2a6c32ea71
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Jan 15 10:11:59 2024 +0000
Fix logic bug spotted by Coverity Scan
---
.../apache/tomcat/util/digester/ServiceBindingPropertySource.java | 2 +-
webapps/docs/changelog.xml | 5 +++++
2 files changed, 6 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 a509a06dc1..52b5650875 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,11 @@
that is no longer included in the JAR. Based on pull request
<pr>684</pr> by Jendrik Johannes. (markt)
</fix>
+ <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>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]