[ 
https://issues.apache.org/jira/browse/TS-5101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kit Chan resolved TS-5101.
--------------------------
    Resolution: Fixed

> 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: 40m
>  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