Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-12-04 Thread via GitHub
arthurscchan commented on PR #222: URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1839720505 @garydgregory Sorry I am bit busy and did not handle that last week. Thanks for fixing that for me. -- This is an automated message from the Apache Git Service. To respond to

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-12-03 Thread via GitHub
garydgregory commented on PR #222: URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1837588329 Closing: Done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-12-03 Thread via GitHub
garydgregory closed pull request #222: CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method URL: https://github.com/apache/commons-codec/pull/222 -- This is an automated message from the Apache Git Service. To respond to the message,

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-12-01 Thread via GitHub
arthurscchan commented on code in PR #222: URL: https://github.com/apache/commons-codec/pull/222#discussion_r1412032098 ## src/main/java/org/apache/commons/codec/net/PercentCodec.java: ## @@ -77,10 +77,15 @@ public PercentCodec() { * * @param alwaysEncodeChars the

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-11-29 Thread via GitHub
garydgregory commented on code in PR #222: URL: https://github.com/apache/commons-codec/pull/222#discussion_r1409857343 ## src/main/java/org/apache/commons/codec/net/PercentCodec.java: ## @@ -77,10 +77,15 @@ public PercentCodec() { * * @param alwaysEncodeChars the

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-11-27 Thread via GitHub
arthurscchan commented on PR #222: URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1828039723 Hi @garydgregory, thanks for your comments and suggestions. I will surely keep that in mind. -- This is an automated message from the Apache Git Service. To respond to the

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-11-27 Thread via GitHub
garydgregory commented on PR #222: URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1827859750 TY @arthurscchan Let's keep in mind that this is a library that needs to make sense (or try to) for users. As opposed to just addressing fuzzing issues in the most expedient

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-11-27 Thread via GitHub
arthurscchan commented on PR #222: URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1827848126 Hi @garydgregory, OK. Sorry for not considering in that direction. I will change the code in this PR to wrap around the possible IndexOutOfBoundException in an EncoderException,

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-11-27 Thread via GitHub
garydgregory commented on PR #222: URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1827843610 Hi @arthurscchan I'm not a fan of making the ctor overly clever in a way that was never documented and is not expected or obvious (IMO). This violates the principle of least

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-11-27 Thread via GitHub
arthurscchan commented on PR #222: URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1827774135 Hi @garydgregory, I think it is a different case. The invalid bytes are provided through constructor, it is only used for the initial setting of the PercentCodec object

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-11-27 Thread via GitHub
arthurscchan commented on PR #222: URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1827764168 @garydgregory Oh, you are right, if we filtered out invalid data, then the round trip result will be differed from the original input. Sorry for missing that. Maybe throwing

Re: [PR] CODEC-314: Fix possible IndexOutOfBoundsException thrown by PercentCodec.insertAlwaysEncodeChars() method [commons-codec]

2023-11-24 Thread via GitHub
garydgregory commented on PR #222: URL: https://github.com/apache/commons-codec/pull/222#issuecomment-1826188320 > Hi @garydgregory, > > In my understanding, the constructor of PecentCodec calls the `insertAlwaysEncodeChars(byte[])` method in [Line