This is an automated email from the ASF dual-hosted git repository.
rgoers pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/release-2.x by this push:
new cedcddd LOG4J2-2813 - serializeToBytes was checking wrong variable
for null
cedcddd is described below
commit cedcdddb88a2b5dae80708a36a1fc0fc17531b94
Author: Ralph Goers <[email protected]>
AuthorDate: Fri Apr 17 15:55:39 2020 -0700
LOG4J2-2813 - serializeToBytes was checking wrong variable for null
---
.../org/apache/logging/log4j/core/layout/AbstractStringLayout.java | 2 +-
src/changes/changes.xml | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git
a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java
b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java
index 4b068e1..bd3d17a 100644
---
a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java
+++
b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java
@@ -280,7 +280,7 @@ public abstract class AbstractStringLayout extends
AbstractLayout<String> implem
protected byte[] serializeToBytes(final Serializer serializer, final
byte[] defaultValue) {
final String serializable = serializeToString(serializer);
- if (serializer == null) {
+ if (serializable == null) {
return defaultValue;
}
return StringEncoder.toBytes(serializable, getCharset());
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index ecc2b02..272673b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -30,6 +30,9 @@
- "remove" - Removed
-->
<release version="2.13.2" date="2020-MM-DD" description="GA Release
2.13.2">
+ <action issue="LOG4J2-2813" dev="rgoers" type="fix" due-to="Keith D
Gregory">
+ serializeToBytes was checking wrong variable for null.
+ </action>
<action issue="LOG4J2-2814" dev="rgoers" type="fix">
Fix Javadoc for ScriptPatternSelector.
</action>