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

ASF GitHub Bot commented on AVRO-1853:
--------------------------------------

GitHub user zicl opened a pull request:

    https://github.com/apache/avro/pull/127

    AVRO-1853: Compiler::toBin crashes on empty string

    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.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zicl/avro master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/avro/pull/127.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #127
    
----
commit 98f6b53494d368dded1d7953c05a0044c9448b17
Author: Zoltan Ivanfi <z...@cloudera.com>
Date:   2016-09-20T17:11:18Z

    AVRO-1853: Compiler::toBin crashes on empty string
    
    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)

Reply via email to