You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2015/03/01 00:35:05 UTC

[jira] [Commented] (LOG4J2-964) StringFormattedMessage serialization is incorrect

    [ https://issues.apache.org/jira/browse/LOG4J2-964?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14341836#comment-14341836 ] 

Gary Gregory commented on LOG4J2-964:
-------------------------------------

Ah, shoot, I did not see you patch and the fix seemed simple. Can you please verify my fix works for you. Feel free to patch over the HEAD of master with a better implementation and tests. That would be greatly appreciated!

> StringFormattedMessage serialization is incorrect
> -------------------------------------------------
>
>                 Key: LOG4J2-964
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-964
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 2.2
>            Reporter: Jonne JyrylÀ
>             Fix For: 2.2.1
>
>         Attachments: 0001-LOG4J2-964-fix-StringFormattedMessage-serialization.patch
>
>
> The method {{writeObject(final ObjectOutputStream out)}} of the class {{org.apache.logging.log4j.message.StringFormattedMessage}} does not write the stringArgs array into the output stream. This causes {{readObject(final ObjectInputStream in)}} to throw an {{EOFException}} when trying to deserialize.
> There is another bug in the same method. The line {{stringArgs[i] = obj.toString();}} throws a {{NullPointerException}} when obj is null.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org