From 500c70ce169a9bc700ed4f05fa9c37e7df13a387 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Fri, 31 May 2013 14:10:49 +0200 Subject: [PATCH] Honour escaped slashes in regular expressions. Closes RADSECPROXY-51. --- radsecproxy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/radsecproxy.c b/radsecproxy.c index 72399a0..b70ea45 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -2432,7 +2432,9 @@ struct modattr *extractmodattr(char *nameval) { if (s[strlen(s) - 1] == '/') s[strlen(s) - 1] = '\0'; - t = strchr(s, '/'); + for (t = strchr(s, '/'); t; t = strchr(t+1, '/')) + if (t == s || t[-1] != '\\') + break; if (!t) return NULL; *t = '\0'; -- 2.1.4