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

ASF subversion and git services commented on KUDU-3646:
-------------------------------------------------------

Commit 34089941debf91a0d1de538a41da482fcb8dcf4a in kudu's branch 
refs/heads/master from Alexey Serbin
[ https://gitbox.apache.org/repos/asf?p=kudu.git;h=34089941d ]

KUDU-3646 fix Base64Decode()

Prior to this patch, Base64Decode() in src/kudu/util/url-coding.cc
had a bug that lead to truncating the output data by discarding
trailing null/zero bytes.

Originally imported from the Impala's codebase [1], the bug has been
lurking for 11+ years in the Kudu's codebase.  Meanwhile, Impala fixed
the issue a long time ago [2].

This patch addresses the issue and adds corresponding test coverage.
In addition, this patch adds extra validation for the input of
Base64Decode() and provides test coverage for that as well.
Also, reference binding to null pointer in url-coding-test.cc has been
addressed as well.

[1] https://github.com/apache/kudu/commit/ce4d760ca
[2] https://issues.apache.org/jira/browse/IMPALA-2878

Change-Id: I7f5d41eb4e41897d520f00b12c6e487ecc5a00fc
Reviewed-on: http://gerrit.cloudera.org:8080/22573
Reviewed-by: Ashwani Raina <ara...@cloudera.com>
Tested-by: Alexey Serbin <ale...@apache.org>
Reviewed-by: Abhishek Chennaka <achenn...@cloudera.com>


> Base64Decode() corrupts data by discarding trailing bytes encoded as 'A'
> ------------------------------------------------------------------------
>
>                 Key: KUDU-3646
>                 URL: https://issues.apache.org/jira/browse/KUDU-3646
>             Project: Kudu
>          Issue Type: Bug
>          Components: hms, master, server, tserver, util
>    Affects Versions: 0.7.0, 0.7.1, 0.8.0, 0.9.0, 0.9.1, 0.10.0, 1.0.0, 1.0.1, 
> 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.7.1, 1.9.0, 
> 1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.11.1, 1.13.0, 1.14.0, 1.15.0, 1.16.0, 
> 1.17.0, 1.17.1
>            Reporter: Alexey Serbin
>            Priority: Major
>
> The implementation of {{Base64Decode()}} imported from Impala in 
> {{src/kudu/util/url-coding.cc}} contains a bug that leads to 
> truncating/corrupting the data by discarding trailing null bytes encoded as 
> 'A' in BASE64.
> For example, {{Base64Decode("YQAA", ...)}} produces {{string("a")}} instead 
> of {{string("a\0\0", 3)}}.  The problem doesn't manifest itself when current 
> implementation of {{Base64Decode()}} is used for text/ASCII data, but using 
> it for binary data (e.g., zlib-compressed) leads to unexpected results.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to