[ 
https://issues.apache.org/jira/browse/TS-5101?focusedWorklogId=34450&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-34450
 ]

ASF GitHub Bot logged work on TS-5101:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Dec/16 18:15
            Start Date: 30/Dec/16 18:15
    Worklog Time Spent: 10m 
      Work Description: GitHub user shukitchan opened a pull request:

    https://github.com/apache/trafficserver/pull/1278

    TS-5101: fix error handling for ts_lua

    @jpeach @zwoop 
    pls help to review

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

    $ git pull https://github.com/shukitchan/trafficserver ts5101

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

    https://github.com/apache/trafficserver/pull/1278.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 #1278
    
----
commit 7e8ca70799224336f8c97d209d2b140e581b4733
Author: Kit Chan <kic...@apache.org>
Date:   2016-12-30T18:13:36Z

    TS-5101: fix error handling for ts_lua

----


Issue Time Tracking
-------------------

            Worklog Id:     (was: 34450)
            Time Spent: 10m
    Remaining Estimate: 0h

> CID 1367515 1367514 1367513 Error handling issues in ts_lua plugin
> ------------------------------------------------------------------
>
>                 Key: TS-5101
>                 URL: https://issues.apache.org/jira/browse/TS-5101
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Lua, Plugins
>            Reporter: Kit Chan
>            Assignee: Kit Chan
>             Fix For: 7.1.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {code}
> ** CID 1367515:  Error handling issues  (CHECKED_RETURN)
> /plugins/experimental/ts_lua/ts_lua_server_response.c: 354 in 
> ts_lua_server_response_set_version()
> ________________________________________________________________________________________________________
> *** CID 1367515:  Error handling issues  (CHECKED_RETURN)
> /plugins/experimental/ts_lua/ts_lua_server_response.c: 354 in 
> ts_lua_server_response_set_version()
> 348       GET_HTTP_CONTEXT(http_ctx, L);
> 349
> 350       TS_LUA_CHECK_SERVER_RESPONSE_HDR(http_ctx);
> 351
> 352       version = luaL_checklstring(L, 1, &len);
> 353
> >>>     CID 1367515:  Error handling issues  (CHECKED_RETURN)
> >>>     Calling "sscanf" without checking return value (as is done elsewhere 
> >>> 61 out of 67 times).
> 354       sscanf(version, "%2u.%2u", &major, &minor);
> 355
> 356       TSHttpHdrVersionSet(http_ctx->server_response_bufp, 
> http_ctx->server_response_hdrp, TS_HTTP_VERSION(major, minor));
> 357
> 358       return 0;
> ** CID 1367514:  Error handling issues  (CHECKED_RETURN)
> /plugins/experimental/ts_lua/ts_lua_client_request.c: 903 in 
> ts_lua_client_request_set_version()
> ________________________________________________________________________________________________________
> *** CID 1367514:  Error handling issues  (CHECKED_RETURN)
> /plugins/experimental/ts_lua/ts_lua_client_request.c: 903 in 
> ts_lua_client_request_set_version()
> 897       ts_lua_http_ctx *http_ctx;
> 898
> 899       GET_HTTP_CONTEXT(http_ctx, L);
> 900
> 901       version = luaL_checklstring(L, 1, &len);
> 902
> >>>     CID 1367514:  Error handling issues  (CHECKED_RETURN)
> >>>     Calling "sscanf" without checking return value (as is done elsewhere 
> >>> 61 out of 67 times).
> 903       sscanf(version, "%2u.%2u", &major, &minor);
> 904
> 905       TSHttpHdrVersionSet(http_ctx->client_request_bufp, 
> http_ctx->client_request_hdrp, TS_HTTP_VERSION(major, minor));
> 906
> 907       return 0;
> 908     }
> ** CID 1367513:  Error handling issues  (CHECKED_RETURN)
> /plugins/experimental/ts_lua/ts_lua_client_response.c: 370 in 
> ts_lua_client_response_set_version()
> ________________________________________________________________________________________________________
> *** CID 1367513:  Error handling issues  (CHECKED_RETURN)
> /plugins/experimental/ts_lua/ts_lua_client_response.c: 370 in 
> ts_lua_client_response_set_version()
> 364       GET_HTTP_CONTEXT(http_ctx, L);
> 365
> 366       TS_LUA_CHECK_CLIENT_RESPONSE_HDR(http_ctx);
> 367
> 368       version = luaL_checklstring(L, 1, &len);
> 369
> >>>     CID 1367513:  Error handling issues  (CHECKED_RETURN)
> >>>     Calling "sscanf" without checking return value (as is done elsewhere 
> >>> 61 out of 67 times).
> 370       sscanf(version, "%2u.%2u", &major, &minor);
> 371
> 372       TSHttpHdrVersionSet(http_ctx->client_response_bufp, 
> http_ctx->client_response_hdrp, TS_HTTP_VERSION(major, minor));
> 373
> 374       return 0;
> 375     }
> {code}



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

Reply via email to