Skip to content

Commit ac0b3b1

Browse files
authored
Increase allowed path env size (#795)
1 parent 2ec279a commit ac0b3b1

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/bin/pg_autoctl/cli_do_tmux.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#include <stdio.h>
1818
#include <stdlib.h>
1919

20+
#if defined(__linux__)
21+
#include <linux/limits.h>
22+
#endif
23+
2024
#include "postgres_fe.h"
2125
#include "pqexpbuffer.h"
2226
#include "snprintf.h"
@@ -440,7 +444,7 @@ cli_do_tmux_script_getopts(int argc, char **argv)
440444
void
441445
tmux_add_command(PQExpBuffer script, const char *fmt, ...)
442446
{
443-
char buffer[BUFSIZE] = { 0 };
447+
char buffer[ARG_MAX] = { 0 };
444448
va_list args;
445449

446450
va_start(args, fmt);
@@ -489,7 +493,7 @@ void
489493
tmux_setenv(PQExpBuffer script,
490494
const char *sessionName, const char *root, int firstPort)
491495
{
492-
char PATH[BUFSIZE] = { 0 };
496+
char PATH[ARG_MAX] = { 0 };
493497
char PG_CONFIG[MAXPGPATH] = { 0 };
494498
char monitor_pguri[MAXCONNINFO] = { 0 };
495499

0 commit comments

Comments
 (0)