You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by br...@apache.org on 2014/07/14 19:39:12 UTC
git commit: TS-1475: Prevent bug where a pointer could be passed with
0 length
Repository: trafficserver
Updated Branches:
refs/heads/master 209fd85c7 -> 553b5d52e
TS-1475: Prevent bug where a pointer could be passed with 0 length
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/553b5d52
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/553b5d52
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/553b5d52
Branch: refs/heads/master
Commit: 553b5d52ebbcee0ceae4a08e42ede668bcf28fba
Parents: 209fd85
Author: Brian Geffon <br...@apache.org>
Authored: Mon Jul 14 10:38:48 2014 -0700
Committer: Brian Geffon <br...@apache.org>
Committed: Mon Jul 14 10:38:48 2014 -0700
----------------------------------------------------------------------
proxy/http/remap/UrlRewrite.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/553b5d52/proxy/http/remap/UrlRewrite.cc
----------------------------------------------------------------------
diff --git a/proxy/http/remap/UrlRewrite.cc b/proxy/http/remap/UrlRewrite.cc
index 549add6..a9897e9 100644
--- a/proxy/http/remap/UrlRewrite.cc
+++ b/proxy/http/remap/UrlRewrite.cc
@@ -287,8 +287,8 @@ void
url_rewrite_remap_request(const UrlMappingContainer& mapping_container, URL *request_url)
{
const char *requestPath;
- int requestPathLen;
- int fromPathLen;
+ int requestPathLen = 0;
+ int fromPathLen = 0;
URL *map_to = mapping_container.getToURL();
URL *map_from = mapping_container.getFromURL();
@@ -327,7 +327,7 @@ url_rewrite_remap_request(const UrlMappingContainer& mapping_container, URL *req
// We might need to insert a trailing slash in the new portion of the path
// if more will be added and none is present and one will be needed.
- if (!fromPathLen && requestPathLen && toPathLen && *(newPath + newPathLen - 1) != '/') {
+ if (!fromPathLen && requestPathLen && newPathLen && toPathLen && *(newPath + newPathLen - 1) != '/') {
*(newPath + newPathLen) = '/';
newPathLen++;
}