diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-06-20 15:19:35 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-06-20 15:19:35 +0100 |
commit | f3974e74f2f1548bf07604fddfa60cf75b2fda57 (patch) | |
tree | caca15553aea5a0be6a0f02e3bb1687aab88634c | |
parent | e433db48162fba76ef60a55d9feee9e23fe548ee (diff) | |
download | xine-lib-f3974e74f2f1548bf07604fddfa60cf75b2fda57.tar.gz xine-lib-f3974e74f2f1548bf07604fddfa60cf75b2fda57.tar.bz2 |
Off-by-one in the HTTP basic auth encoding function.
-rw-r--r-- | src/input/input_http.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c index dd9798bb1..a5a25f0af 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -232,9 +232,9 @@ static int _x_use_proxy(http_input_class_t *this, const char *host) { static void http_plugin_basicauth (const char *user, const char *password, char** dest) { const size_t totlen = strlen(user) + (password ? strlen(password) : 0) + 1; const size_t enclen = ((totlen + 2) * 4 ) / 3 + 12; - char tmp[totlen]; + char tmp[totlen + 1]; - snprintf(tmp, totlen, "%s:%s", user, password ? : ""); + snprintf(tmp, totlen + 1, "%s:%s", user, password ? : ""); *dest = malloc(enclen); av_base64_encode(*dest, enclen, tmp, totlen); |