Skip to content

Commit

Permalink
in_forward: Handle '' and "" or absent value for yaml value as an emp…
Browse files Browse the repository at this point in the history
…ty shared_key

Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Dec 3, 2024
1 parent d573777 commit 7aaeebe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion plugins/in_forward/fw_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,18 @@ struct flb_in_fw_config *fw_config_init(struct flb_input_instance *i_ins)
/* Shared Key */
p = flb_input_get_property("shared_key", i_ins);
if (p) {
config->shared_key = flb_sds_create(p);
if (strcmp(p, "\'\'") == 0 || strcmp(p, "\"\"") == 0) {
config->shared_key = flb_sds_create("");
}
else {
config->shared_key = flb_sds_create(p);
}
if (config->shared_key == NULL) {
flb_plg_error(i_ins, "could not initialize shared_key");
fw_config_destroy(config);

return NULL;
}
}
else {
config->shared_key = NULL;
Expand Down

0 comments on commit 7aaeebe

Please sign in to comment.