You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ilya Maykov (JIRA)" <ji...@apache.org> on 2011/06/09 00:03:59 UTC
[jira] [Issue Comment Edited] (THRIFT-1047)
rb_thrift_memory_buffer_write treats arg as string without check, segfaults
if you pass non-string
[ https://issues.apache.org/jira/browse/THRIFT-1047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13046253#comment-13046253 ]
Ilya Maykov edited comment on THRIFT-1047 at 6/8/11 10:03 PM:
--------------------------------------------------------------
Jake - can you also add the type check to the pure-Ruby implementation of MemoryBufferTransport (in lib/rb/lib/thrift/transport/memory_buffer_transport.rb)? Otherwise, the native and non-native implementations will behave differently. This is relevant for non-MRI Ruby interpreters (JRuby, maybe some others) where the native extensions don't load correctly and the thrift gem falls back to the native implementations.
was (Author: ilyam):
Jake - can you also add the type check to the pure-Ruby implementation of MemoryBufferTransport (in lib/rb/thrift/transport/memory_buffer_transport.rb)? Otherwise, the native and non-native implementations will behave differently. This is relevant for non-MRI Ruby interpreters (JRuby, maybe some others) where the native extensions don't load correctly and the thrift gem falls back to the native implementations.
> rb_thrift_memory_buffer_write treats arg as string without check, segfaults if you pass non-string
> --------------------------------------------------------------------------------------------------
>
> Key: THRIFT-1047
> URL: https://issues.apache.org/jira/browse/THRIFT-1047
> Project: Thrift
> Issue Type: Bug
> Components: Ruby - Library
> Affects Versions: 0.5
> Reporter: Jake Donham
>
> I think there should be a call to Check_Type(str, T_STRING) in there
> VALUE rb_thrift_memory_buffer_write(VALUE self, VALUE str) {
> VALUE buf = GET_BUF(self);
> rb_str_buf_cat(buf, RSTRING_PTR(str), RSTRING_LEN(str));
> return Qnil;
> }
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira