[
https://issues.apache.org/jira/browse/AVRO-1853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15526408#comment-15526408
]
ASF subversion and git services commented on AVRO-1853:
-------------------------------------------------------
Commit bc3fffb067c93ebece18a80f455ea4662a240e0b in avro's branch
refs/heads/master from [~zi]
[ https://git-wip-us.apache.org/repos/asf?p=avro.git;h=bc3fffb ]
AVRO-1853: Compiler::toBin crashes on empty string. Contributed by Zoltan
Ivanfi.
Added a unit test triggering the bug then fixed the bug. Modified build
process to use debug builds for tests to allow catching bugs of this
type.
> Compiler::toBin(const std::string& s) crashes on empty string
> -------------------------------------------------------------
>
> Key: AVRO-1853
> URL: https://issues.apache.org/jira/browse/AVRO-1853
> Project: Avro
> Issue Type: Bug
> Components: c++
> Affects Versions: 1.8.1
> Environment: Win64 debug
> Reporter: Hans Thulin
> Assignee: Zoltan Ivanfi
> Priority: Critical
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> Compiler::toBin(const std::string& s) crashes if s is empty. A simple sanity
> check should fix it:
> static vector<uint8_t> toBin(const std::string& s)
> {
> vector<uint8_t> result;
> if(!s.empty())
> {
> result.resize(s.size());
> std::copy(s.c_str(), s.c_str() + s.size(), &result[0]);
> }
> return result;
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)