summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich2022-06-13 13:48:35 +0000
committerJo-Philipp Wich2022-06-14 14:54:06 +0000
commit53886e559b9765c61db646fffb2953ab12aac1e7 (patch)
treeb5e86a465957c8acbf17d2f5300337db7cfe31cb
parent5994466353ecbd4e6fac738aa956b2cbd9f6308b (diff)
downloadfirewall4-53886e559b9765c61db646fffb2953ab12aac1e7.tar.gz
fw4: fix crash in parse_cthelper() if no helpers are present
Properly deal with a possibly uninitialized helper object array. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--root/usr/share/ucode/fw4.uc2
1 files changed, 1 insertions, 1 deletions
diff --git a/root/usr/share/ucode/fw4.uc b/root/usr/share/ucode/fw4.uc
index db1e580..95e2540 100644
--- a/root/usr/share/ucode/fw4.uc
+++ b/root/usr/share/ucode/fw4.uc
@@ -1037,7 +1037,7 @@ return {
if (!rv)
return null;
- let helper = filter(this.state.helpers, h => (h.name == rv.val))[0];
+ let helper = filter(this.state.helpers, h => (h.name == rv.val))?.[0];
return helper ? { ...rv, ...helper } : null;
},