diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c
index 506a046..29a39f8 100644
--- a/modules/proxy/mod_proxy.c
+++ b/modules/proxy/mod_proxy.c
@@ -1442,7 +1442,7 @@ static char *de_socketfy(apr_pool_t *p, char *url)
* the UDS path... ignore it
*/
if (!strncasecmp(url, "unix:", 5) &&
- ((ptr = ap_strchr(url, '|')) != NULL)) {
+ ((ptr = ap_strchr_c(url + 5, '|')) != NULL)) {
/* move past the 'unix:...|' UDS path info */
char *ret, *c;
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c
index ca6cb87..3e21fa7 100644
--- a/modules/proxy/proxy_util.c
+++ b/modules/proxy/proxy_util.c
@@ -2032,8 +2032,9 @@ PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker,
* check to see if r->filename starts with 'proxy:'
*/
if (apr_table_get(r->notes, "rewrite-proxy") &&
- (ptr2 = ap_strcasestr(r->filename, "unix:")) &&
- (ptr = ap_strchr(ptr2, '|'))) {
+ !ap_cstr_casecmpn(r->filename + 6, "unix:", 5) &&
+ (ptr2 = r->filename + 6 + 5, ptr = ap_strchr(ptr2, '|'))) {
+
apr_uri_t urisock;
apr_status_t rv;
*ptr = '\0';