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

ASF GitHub Bot commented on CLOWNFISH-84:
-----------------------------------------

GitHub user rectang opened a pull request:

    https://github.com/apache/lucy-clownfish/pull/64

    CLOWNFISH-84 guarantee null-terminated arg to strtod

    Inside Str_To_F64 we use strtod, which requires a nul-terminated C
    string argument.  Now that Clownfish Strings consistently lack
    nul-termination, we need to copy content into a nul-terminated buffer
    and pass that to strtod.

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

    $ git pull https://github.com/rectang/lucy-clownfish 
CLOWNFISH-84-nul-term-strtod

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

    https://github.com/apache/lucy-clownfish/pull/64.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 #64
    
----
commit 4dab61a5717135c4f60fc6d063e21870a453bb1f
Author: Marvin Humphrey <[email protected]>
Date:   2016-03-14T23:05:23Z

    Ensure nul-terminated arg to strtod.
    
    Inside Str_To_F64 we use strtod, which requires a nul-terminated C
    string argument.  Now that Clownfish Strings consistently lack
    nul-termination, we need to copy content into a nul-terminated buffer
    and pass that to strtod.

----


> Guarantee nul-terminated arg to strtod in Str_To_F64
> ----------------------------------------------------
>
>                 Key: CLOWNFISH-84
>                 URL: https://issues.apache.org/jira/browse/CLOWNFISH-84
>             Project: Apache Lucy-Clownfish
>          Issue Type: Bug
>          Components: Core
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>
> As of 0.5.0, Strings consistently lack nul-termination, so usage of `strtod` 
> in `Str_To_F64` needs to be adjusted.  The solution is to copy the string 
> content into a nul-terminated buffer.
> Long term, a more efficient solution would be to craft our own 
> string-to-double conversion routine and replace `strtod`, but that's a lot of 
> work for little benefit right now.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to