diff mbox series

suricatta/lua: Fix libconfig bool handling

Message ID 20230303143820.44598-1-christian.storm@siemens.com
State Accepted
Delegated to: Stefano Babic
Headers show
Series suricatta/lua: Fix libconfig bool handling | expand

Commit Message

Storm, Christian March 3, 2023, 2:38 p.m. UTC
libconfig's config_setting_get_bool() returns an
int which is consequently not processed as bool
by push_to_table(). Fix it so that bool values
are actually boolean Lua values.

Signed-off-by: Christian Storm <christian.storm@siemens.com>
---
 suricatta/server_lua.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/suricatta/server_lua.c b/suricatta/server_lua.c
index e0b38b15..35331264 100644
--- a/suricatta/server_lua.c
+++ b/suricatta/server_lua.c
@@ -1826,7 +1826,7 @@  static int config_section_to_table(void *setting, void *data)
 			break;
 		case CONFIG_TYPE_BOOL:
 			push_to_table((lua_State *)data, entry->name,
-				      config_setting_get_bool(entry));
+				      (bool)config_setting_get_bool(entry));
 			break;
 		case CONFIG_TYPE_FLOAT:
 			push_to_table((lua_State *)data, entry->name,