Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/22573 )
Change subject: KUDU-3646 fix Base64Decode() ...................................................................... Patch Set 3: (2 comments) http://gerrit.cloudera.org:8080/#/c/22573/3//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/22573/3//COMMIT_MSG@7 PS3, Line 7: fix Base64Decode() > Can you also add a sample scenario that manifests this issue. There is a bunch of them now in the updated url-coding-test.cc, Base64Test.Basic. All the modified strings there except for the empty input string are exactly about this. You could see that they are failing with previous version of Base64Decode(). http://gerrit.cloudera.org:8080/#/c/22573/3/src/kudu/util/url-coding-test.cc File src/kudu/util/url-coding-test.cc: http://gerrit.cloudera.org:8080/#/c/22573/3/src/kudu/util/url-coding-test.cc@133 PS3, Line 133: ASSERT_FALSE(Base64Decode("====", &out)); > Maybe add another input that has padding before as well as after encoded nu Thank you for taking a look at this. I tried to add that one, and surprisingly for "=A==" the implementation returns OK, meaning that boost's binary_from_base64 is OK with such input (and it's OK with "=AAA" as well). I guess it's a good venue for a follow-up patch to take care of various negative scenarios, while keeping this patch focused on addressing the issue with truncating all the trailing null bytes. I removed Base64DecodeTest.InvalidInput altogether. -- To view, visit http://gerrit.cloudera.org:8080/22573 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7f5d41eb4e41897d520f00b12c6e487ecc5a00fc Gerrit-Change-Number: 22573 Gerrit-PatchSet: 3 Gerrit-Owner: Alexey Serbin <[email protected]> Gerrit-Reviewer: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Ashwani Raina <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Marton Greber <[email protected]> Gerrit-Comment-Date: Wed, 05 Mar 2025 17:19:39 +0000 Gerrit-HasComments: Yes
