[GitHub] trafficserver pull request #1347: TS-5022: nullptr check

2017-01-19 Thread SolidWallOfCode
Github user SolidWallOfCode commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1347#discussion_r96964550
  
--- Diff: proxy/http/HttpSM.cc ---
@@ -4062,13 +4062,17 @@ HttpSM::do_remap_request(bool run_inline)
   }
 
   // check if the overridden client cert filename is already attached to 
an existing ssl context
-  ats_scoped_str 
clientCert(Layout::relative_to(t_state.txn_conf->client_cert_filepath, 
t_state.txn_conf->client_cert_filename));
-  auto tCTX = params->getCTX(clientCert);
-
-  if (tCTX == nullptr) {
-// make new client ctx and add it to the ctx list
-auto tctx = params->getNewCTX(clientCert);
-params->InsertCTX(clientCert, tctx);
+  if (t_state.txn_conf->client_cert_filepath && 
t_state.txn_conf->client_cert_filename) {
--- End diff --

Are these set if the cert name is `NULL`? We shouldn't be doing the 
`ats_scoped_str` if this is guaranteed to fail. In fact, the string allocation 
should certainly be moved under the check on `clientCert` otherwise a useless 
string allocation is done every remap.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1347: TS-5022: nullptr check

2017-01-19 Thread shinrich
Github user shinrich closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1347: TS-5022: nullptr check

2017-01-19 Thread persiaAziz
GitHub user persiaAziz opened a pull request:

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

TS-5022: nullptr check



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

$ git pull https://github.com/persiaAziz/trafficserver TS-5022

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

https://github.com/apache/trafficserver/pull/1347.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 #1347


commit 3cece67e3411d66c2e46a6a03bb5f687851aa5e4
Author: Syeda Persia Aziz 
Date:   2017-01-19T05:36:35Z

TS-5022: nullptr check




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---