1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avformat/http: prevent truncation of sanitized_path

path1 and sanitized_path are both MAX_URL_SIZE bytes long, yet the latter is
copied from the former with the addition of one extra character.

Should fix a -Wformat-truncation warning.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2021-06-09 17:01:02 -03:00
parent 522f577d7e
commit b46817d9c3

View File

@@ -194,7 +194,7 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options)
char *hashmark; char *hashmark;
char hostname[1024], hoststr[1024], proto[10]; char hostname[1024], hoststr[1024], proto[10];
char auth[1024], proxyauth[1024] = ""; char auth[1024], proxyauth[1024] = "";
char path1[MAX_URL_SIZE], sanitized_path[MAX_URL_SIZE]; char path1[MAX_URL_SIZE], sanitized_path[MAX_URL_SIZE + 1];
char buf[1024], urlbuf[MAX_URL_SIZE]; char buf[1024], urlbuf[MAX_URL_SIZE];
int port, use_proxy, err, location_changed = 0; int port, use_proxy, err, location_changed = 0;
HTTPContext *s = h->priv_data; HTTPContext *s = h->priv_data;