Fix array subscription in unescape_url

Passwords with url escaped characters were parsed incorrectly. The
variable used for iterating over `url` should be `i`, not `pos`. This
patch fixes the problem.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
This commit is contained in:
Hexchain Tong
2014-06-12 12:55:03 +08:00
committed by Nikos Mavrogiannopoulos
parent 11bc2819da
commit 41ff067641

View File

@@ -86,8 +86,8 @@ char *unescape_url(void *pool, const char *url, unsigned len, unsigned *out_len)
char b[3];
unsigned int u;
b[0] = url[pos + 1];
b[1] = url[pos + 2];
b[0] = url[i + 1];
b[1] = url[i + 2];
b[2] = 0;
if (sscanf(b, "%02x", &u) <= 0) {