Change bgw_main field length to BGW_MAXLEN

The content of bgw_main is copied into BackgroundWorker.
bgw_function_name, which has a length of BGW_MAXLEN. This patch ensures
that the size of these fields has the same length.
This commit is contained in:
Jan Nidzwetzki 2023-02-17 16:24:45 +01:00 committed by Jan Nidzwetzki
parent 91b4a66eb9
commit 83fc20f195
2 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,7 @@ ts_bgw_start_worker(const char *name, const BgwParams *bgw_params)
strlcpy(worker.bgw_name, name, BGW_MAXLEN);
strlcpy(worker.bgw_library_name, ts_extension_get_so_name(), BGW_MAXLEN);
strlcpy(worker.bgw_function_name, bgw_params->bgw_main, sizeof(worker.bgw_function_name));
strlcpy(worker.bgw_function_name, bgw_params->bgw_main, BGW_MAXLEN);
memcpy(worker.bgw_extra, bgw_params, sizeof(*bgw_params));

View File

@ -40,7 +40,7 @@ typedef struct BgwParams
int32 ttl;
/** Name of function to call when starting the background worker. */
char bgw_main[NAMEDATALEN];
char bgw_main[BGW_MAXLEN];
} BgwParams;
/**