tool_paramhlp: bump maximum post data size in memory to 16GB

- stick to 2GB for 32bit systems.

Reported-by: Tim Yuer
Fixes #14521
Closes #14523
This commit is contained in:
Daniel Stenberg 2024-08-13 09:12:18 +02:00
parent 8ae7049f4b
commit ad6320b8a5
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 6 additions and 4 deletions

View File

@ -90,12 +90,11 @@ static size_t memcrlf(char *orig,
return total; /* no delimiter found */
}
#define MAX_FILE2STRING (256*1024*1024) /* big enough ? */
#define MAX_FILE2STRING MAX_FILE2MEMORY
ParameterError file2string(char **bufp, FILE *file)
{
struct curlx_dynbuf dyn;
DEBUGASSERT(MAX_FILE2STRING < INT_MAX); /* needs to fit in an int later */
curlx_dyn_init(&dyn, MAX_FILE2STRING);
if(file) {
do {
@ -133,7 +132,6 @@ ParameterError file2memory(char **bufp, size_t *size, FILE *file)
size_t nread;
struct curlx_dynbuf dyn;
/* The size needs to fit in an int later */
DEBUGASSERT(MAX_FILE2MEMORY < INT_MAX);
curlx_dyn_init(&dyn, MAX_FILE2MEMORY);
do {
char buffer[4096];

View File

@ -30,7 +30,11 @@ struct getout *new_getout(struct OperationConfig *config);
ParameterError file2string(char **bufp, FILE *file);
#define MAX_FILE2MEMORY (1024*1024*1024) /* big enough ? */
#if SIZEOF_SIZE_T > 4
#define MAX_FILE2MEMORY (16LL*1024*1024*1024)
#else
#define MAX_FILE2MEMORY (INT_MAX)
#endif
ParameterError file2memory(char **bufp, size_t *size, FILE *file);