You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@htrace.apache.org by "Abraham Elmahrek (JIRA)" <ji...@apache.org> on 2015/08/17 23:37:46 UTC

[jira] [Commented] (HTRACE-224) htrace C client: htrace_conf_get_u64, htrace_conf_get_double can't handle spaces at the end of strings

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

Abraham Elmahrek commented on HTRACE-224:
-----------------------------------------

# htrace-c/src/core/conf.c#L181 - I think the logic might be wrong.
{code}
         if (!((c != ' ') || (c != '\t'))) {
             htrace_log(log, "error parsing %s for %s: garbage at end "
                        "of string.\n", in, key);
             return 0;
         }
{code}
It seems to be that the following will always be false since only 1 of the subexpressions can ever be true.
{code}
!((c != ' ') || (c != '\t'))
{code}

# htrace-c/src/core/conf.c#L232 - I think the logic might be wrong.
{code}
        if (!((c == ' ') || (c != '\t'))) {
             htrace_log(log, "error parsing %s for %s: garbage at end "
                        "of string.\n", in, key);
             return 0;
         }
{code}
It seems to be that the following will be true only when c = '\t'.
{code}
!((c == ' ') || (c != '\t'))
{code}
This means that c == ' ' is not a useful comparison.

> htrace C client: htrace_conf_get_u64, htrace_conf_get_double can't handle spaces at the end of strings
> ------------------------------------------------------------------------------------------------------
>
>                 Key: HTRACE-224
>                 URL: https://issues.apache.org/jira/browse/HTRACE-224
>             Project: HTrace
>          Issue Type: Bug
>    Affects Versions: 3.2.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HTRACE-224.001.patch
>
>
> htrace C client: htrace_conf_get_u64, htrace_conf_get_double can't handle spaces at the end of strings.  It should ignore the whitespace, but instead it treats it as an error.



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