# HG changeset patch # User rbultje # Date 1236086777 0 # Node ID e04458242c5490ce63343ad746be87229c6df978 # Parent 3176b13b0881da25cfd975d59fb459a2926af5e4 Reduce allocated length of the HTTP authentication request field buffer, as noticed by Stefano and Luca in the "[PATCH]RTSP Basic Authentication" mailinglist thread. av_base64_encode() was recently changed. The previous implementation required 12 extra bytes (ceil(len(src)/3.)*4+12), whereas the new one is guaranteed to fit in an exact buffer (ceil(len(src)/3.)*4), plus one extra byte for the trailing zero. This change fixes no bug, it just slightly decreases the amount of allocated memory. diff -r 3176b13b0881 -r e04458242c54 http.c --- a/http.c Tue Mar 03 12:57:07 2009 +0000 +++ b/http.c Tue Mar 03 13:26:17 2009 +0000 @@ -212,7 +212,7 @@ int post, err, ch; char line[1024], *q; char *auth_b64; - int auth_b64_len = strlen(auth)* 4 / 3 + 12; + int auth_b64_len = (strlen(auth) + 2) / 3 * 4 + 1; int64_t off = s->off;