diff mbox series

[FFmpeg-devel] libavformat: increase MAX_URL_SIZE

Message ID 03aae8d1-edc7-4bb8-b2c8-23ac49c665c0@gmail.com
State New
Headers show
Series [FFmpeg-devel] libavformat: increase MAX_URL_SIZE | expand

Checks

Context Check Description
andriy/configure_x86 warning Failed to apply patch
yinshiyou/configure_loongarch64 warning Failed to apply patch

Commit Message

WooDzu Oct. 28, 2023, 1:04 p.m. UTC
With the rise of object storage, like S3, it is not uncommon to generate
long pre-signed URLs. When a pre-signed URL is generated using a
short-lived credentials it may include a query parameter called
X-Amz-Security-Token that is 4kB on its own.
The current MAX_URL_SIZE will trim the URL with no any errors or
warnings and the request will fail with a http 400 error.

Signed-off-by: Piotr Gasiorowski <piotr@lwks.com>
---
  libavformat/internal.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anton Khirnov Nov. 8, 2023, 3:32 p.m. UTC | #1
Quoting WooDzu (2023-10-28 15:04:38)
> With the rise of object storage, like S3, it is not uncommon to generate
> long pre-signed URLs. When a pre-signed URL is generated using a
> short-lived credentials it may include a query parameter called
> X-Amz-Security-Token that is 4kB on its own.
> The current MAX_URL_SIZE will trim the URL with no any errors or
> warnings and the request will fail with a http 400 error.

Why do we have a static limit in the first place? Wouldn't it be better
to make the relevant strings dynamically allocated?
diff mbox series

Patch

From bfc0dc3e68f1d1cec33084bbea0dd87e19d325d5 Mon Sep 17 00:00:00 2001
From: Piotr Gasiorowski <piotr@lwks.com>
Date: Sat, 28 Oct 2023 14:00:38 +0200
Subject: [PATCH] libavformat: increase MAX_URL_SIZE

With the rise of object storage, like S3, it is not uncommon to generate
long pre-signed URLs. When a pre-signed URL is generated using a
short-lived credentials it may include a query parameter called
X-Amz-Security-Token that is 4kB on its own.
The current MAX_URL_SIZE will trim the URL with no any errors or
warnings and the request will fail with a http 400 error.

Signed-off-by: Piotr Gasiorowski <piotr@lwks.com>
---
 libavformat/internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index 7702986c9c..d6465bad7c 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -27,7 +27,7 @@ 
 
 #include "avformat.h"
 
-#define MAX_URL_SIZE 4096
+#define MAX_URL_SIZE 8192
 
 /** size of probe buffer, for guessing file type from file contents */
 #define PROBE_BUF_MIN 2048
-- 
2.39.2 (Apple Git-143)