mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-25 16:16:29 +00:00
Make various buffers larger
MAXLEN definitely needed to be bigger to properly format fairly common connection strings. In addition, the reliance on xsnprintf helps detect cases where even this buffer is not long enough. the buffer in parse_config has been made bigger in a bit of sloppy programming, but what really needs to happen is reporting when a line cannot be properly parsed/is too big for the buffer. That is just a kludge. Signed-off-by: Dan Farina <drfarina@acm.org> Signed-off-by: Peter van Hardenberg <pvh@heroku.com>
This commit is contained in:
committed by
Peter van Hardenberg
parent
fc13d50e37
commit
ec73a07e2f
2
config.c
2
config.c
@@ -15,7 +15,7 @@ void
|
|||||||
parse_config(const char *config_file, char *cluster_name, int *node,
|
parse_config(const char *config_file, char *cluster_name, int *node,
|
||||||
char *conninfo)
|
char *conninfo)
|
||||||
{
|
{
|
||||||
char *s, buff[256];
|
char *s, buff[1024];
|
||||||
FILE *fp = fopen (config_file, "r");
|
FILE *fp = fopen (config_file, "r");
|
||||||
|
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define _STRUTIL_H_
|
#define _STRUTIL_H_
|
||||||
|
|
||||||
#define QUERY_STR_LEN 8192
|
#define QUERY_STR_LEN 8192
|
||||||
#define MAXLEN 80
|
#define MAXLEN 1024
|
||||||
|
|
||||||
|
|
||||||
extern int xsnprintf(char *str, size_t size, const char *format, ...);
|
extern int xsnprintf(char *str, size_t size, const char *format, ...);
|
||||||
|
|||||||
Reference in New Issue
Block a user