[
https://issues.apache.org/jira/browse/TS-5018?focusedWorklogId=31272&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-31272
]
ASF GitHub Bot logged work on TS-5018:
--------------------------------------
Author: ASF GitHub Bot
Created on: 27/Oct/16 23:28
Start Date: 27/Oct/16 23:28
Worklog Time Spent: 10m
Work Description: GitHub user masaori335 opened a pull request:
https://github.com/apache/trafficserver/pull/1161
TS-5018: Fix CID 1365301: Control flow issues (DEADCODE)
I think Coverity says that when `state` is not `PARSER_IN_REGEX`,
`extracting_token` is always false.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/masaori335/trafficserver ts-5018
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafficserver/pull/1161.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 #1161
----
commit c45acda3199f0842ffaee8f3a52d8cde57d73fcb
Author: Masaori Koshiba <[email protected]>
Date: 2016-10-27T22:25:52Z
TS-5018: Fix CID 1365301: Control flow issues (DEADCODE)
----
Issue Time Tracking
-------------------
Worklog Id: (was: 31272)
Time Spent: 10m
Remaining Estimate: 0h
> CID 1365301: Control flow issues (DEADCODE)
> ---------------------------------------------
>
> Key: TS-5018
> URL: https://issues.apache.org/jira/browse/TS-5018
> Project: Traffic Server
> Issue Type: Bug
> Components: Plugins
> Reporter: Masaori Koshiba
> Assignee: Masaori Koshiba
> Fix For: 7.1.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {noformat}
> ** CID 1365301: Control flow issues (DEADCODE)
> /plugins/header_rewrite/parser.cc: 67 in Parser::Parser(const
> std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
> ________________________________________________________________________________________________________
> *** CID 1365301: Control flow issues (DEADCODE)
> /plugins/header_rewrite/parser.cc: 67 in Parser::Parser(const
> std::basic_string<char, std::char_traits<char>, std::allocator<char>>&)()
> 61 cur_token_length = i - cur_token_start + 1;
> 62 _tokens.push_back(line.substr(cur_token_start,
> cur_token_length));
> 63 state = PARSER_DEFAULT;
> 64 extracting_token = false;
> 65 } else if (!extracting_token) {
> 66 // /'s elsewhere are just consumed, but we should not end up
> here if we're not extracting a token
> >>> CID 1365301: Control flow issues (DEADCODE)
> >>> Execution cannot reach this statement: "TSError("[%s] malformed
> >>> reg...".
> 67 TSError("[%s] malformed regex \"%s\" ignoring...",
> PLUGIN_NAME, line.c_str());
> 68 }
> 69 } else if ((state != PARSER_IN_REGEX) && (line[i] == '\\')) {
> 70 // Escaping
> 71 if (!extracting_token) {
> 72 extracting_token = true;
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)