You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Doug Cutting (Commented) (JIRA)" <ji...@apache.org> on 2012/01/24 00:39:40 UTC

[jira] [Commented] (AVRO-968) Avro C - avro_value_cmp_fast() may return garbage value for AVRO_STRING comparison

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

Doug Cutting commented on AVRO-968:
-----------------------------------

This issue can be resolved as fixed, right?
                
> Avro C - avro_value_cmp_fast() may return garbage value for AVRO_STRING comparison
> ----------------------------------------------------------------------------------
>
>                 Key: AVRO-968
>                 URL: https://issues.apache.org/jira/browse/AVRO-968
>             Project: Avro
>          Issue Type: Bug
>          Components: c
>    Affects Versions: 1.6.1, 1.6.2, 1.7.0
>         Environment: All. Currently using gcc 4.6.1 on Ubuntu 11.10.
>            Reporter: Vivek Nadkarni
>            Priority: Minor
>             Fix For: 1.6.2, 1.7.0
>
>         Attachments: 0001-AVRO-968.-C-Fixed-avro_value_cmp-on-string-values.patch, AVRO-968.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Compiler shows a warning that variables may be used uninitialized in avro_value_cmp_fast():
> /home/user/avro-trunk/lang/c/src/value.c: In function 'avro_value_cmp_fast':
> /home/user/avro-trunk/lang/c/src/value.c:387:13: warning: 'size2' may be used uninitialized in this function [-Wuninitialized]
> /home/user/avro-trunk/lang/c/src/value.c:387:13: warning: 'size1' may be used uninitialized in this function [-Wuninitialized]
> /home/user/avro-trunk/lang/c/src/value.c:388:11: warning: 'buf1' may be used uninitialized in this function [-Wuninitialized]
> /home/user/avro-trunk/lang/c/src/value.c:388:11: warning: 'buf2' may be used uninitialized in this function [-Wuninitialized]
> Examining the file shows that the warnings are real, and the variables size1, buf1, size2, buf2 should be loaded before they are used. The simple fix is to copy matching code from the function avro_value_equal_fast(). I will attach that code in an upcoming patch. 
> Cheers,
> Vivek

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira