summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pazdziora <jpazdziora@redhat.com>2016-11-22 14:05:12 +0100
committerJan Pazdziora <jpazdziora@redhat.com>2016-11-22 15:59:02 +0100
commit438bd24fcb47c879227777d83aa0bac3f1326522 (patch)
treefc77c73170a5f7706d1e085362d24a28f62b4a73
parentb0db1a8b25c6d44748eea01359b6e4ebcb539d8a (diff)
downloadmod_authnz_pam-438bd24fcb47c879227777d83aa0bac3f1326522.tar.gz
mod_authnz_pam-438bd24fcb47c879227777d83aa0bac3f1326522.tar.xz
mod_authnz_pam-438bd24fcb47c879227777d83aa0bac3f1326522.zip
Fix AuthPAMExpiredRedirect %s escaping on Apache 2.2.
-rw-r--r--mod_authnz_pam.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mod_authnz_pam.c b/mod_authnz_pam.c
index 23ccf61..22718ea 100644
--- a/mod_authnz_pam.c
+++ b/mod_authnz_pam.c
@@ -85,8 +85,7 @@ static const char * ap_escape_urlencoded(apr_pool_t * pool, const char * buffer)
while (*buffer) {
if (!apr_isalnum(*buffer) && !strchr(".-*_ ", *buffer)) {
*p++ = '%';
- sprintf(p, "%02x", *p);
- *p += 2;
+ p += snprintf(p, 3, "%02x", *buffer);
} else if (*buffer == ' ') {
*p++ = '+';
} else {
@@ -94,7 +93,7 @@ static const char * ap_escape_urlencoded(apr_pool_t * pool, const char * buffer)
}
buffer++;
}
- *p++ = '\0';
+ *p = '\0';
return copy;
}
#endif