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

ASF GitHub Bot commented on LUCY-294:
-------------------------------------

GitHub user rectang opened a pull request:

    https://github.com/apache/lucy/pull/35

    LUCY-294 Ensure nul-terminated C strings in test code.

    Use `Str_To_Utf8` which is guaranteed to return a nul-terminated C
    string instead of `Str_To_Ptr8`.

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

    $ git pull https://github.com/rectang/lucy LUCY-294-nul-term

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

    https://github.com/apache/lucy/pull/35.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 #35
    
----
commit d9c7f35926aa337320112d6f03736b0cd13261c0
Author: Marvin Humphrey <[email protected]>
Date:   2016-03-14T21:44:45Z

    Ensure nul-terminated C strings in test code.
    
    Use `Str_To_Utf8` which is guaranteed to return a nul-terminated C
    string instead of `Str_To_Ptr8`.

----


> Nul-terminate C strings in test code
> ------------------------------------
>
>                 Key: LUCY-294
>                 URL: https://issues.apache.org/jira/browse/LUCY-294
>             Project: Lucy
>          Issue Type: Bug
>          Components: Test
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>            Priority: Minor
>
> The behavior of String's `Get_Ptr8` method has changed: it now consistently 
> returns a memory buffer which is not nul-terminated.
> Lucy uses `Get_Ptr8` in numerous places.  All of the runtime usages are OK, 
> but there are a number of test cases that improperly assume that it returns a 
> nul-terminated C string.
> The solution is to use `To_Utf8` instead, which returns a newly allocated 
> nul-terminated buffer.



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

Reply via email to