You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/10/10 03:54:05 UTC
[jira] [Commented] (THRIFT-3378) c_glib service does not handle
negative Thrift byte values correctly
[ https://issues.apache.org/jira/browse/THRIFT-3378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14951496#comment-14951496 ]
ASF GitHub Bot commented on THRIFT-3378:
----------------------------------------
GitHub user nsuke opened a pull request:
https://github.com/apache/thrift/pull/644
THRIFT-3378 c_glib service does not handle negative Thrift byte value…
…s correctly
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nsuke/thrift THRIFT-3378
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/644.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 #644
----
commit 2ffb9e69f3049709dbb6eeb077b60ff36adda138
Author: Nobuaki Sukegawa <ns...@gmail.com>
Date: 2015-10-10T01:45:42Z
THRIFT-3378 c_glib service does not handle negative Thrift byte values correctly
----
> c_glib service does not handle negative Thrift byte values correctly
> --------------------------------------------------------------------
>
> Key: THRIFT-3378
> URL: https://issues.apache.org/jira/browse/THRIFT-3378
> Project: Thrift
> Issue Type: Bug
> Components: C glib - Compiler
> Reporter: Nobuaki Sukegawa
>
> There's a problematic type cast in generated c_glib service code that treat the sign bit of gint8 as normal bit (i.e. 128).
> The problem is illustrated as follows.
> {code}
> int i = 0;
> users_handler_func((*gint8)&i); // Suppose this function tries to set i to -100
> store_handler_result(i); // This stores 156, not -100
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)