summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2012-06-24 09:33:28 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2012-06-24 09:33:28 +0000
commit8e48c6c36ac8ee6d58348aa898c6f13d1f9c45b6 (patch)
tree42342bd3355213ea8575c25d5e013e1fe424f31a /src
parentd74c9788b7a1c79653067d87ab45e5e1ee85487c (diff)
downloadirssi-8e48c6c36ac8ee6d58348aa898c6f13d1f9c45b6.zip
Properly validate the argument of Irssi::theme_register as an array reference,
patch by Olof Johansson. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5214 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/perl/ui/Themes.xs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/perl/ui/Themes.xs b/src/perl/ui/Themes.xs
index 86507546..ff025ee9 100644
--- a/src/perl/ui/Themes.xs
+++ b/src/perl/ui/Themes.xs
@@ -90,8 +90,12 @@ PREINIT:
CODE:
if (!SvROK(formats))
- croak("formats is not a reference to list");
+ croak("formats is not a reference");
+
av = (AV *) SvRV(formats);
+ if (SvTYPE(av) != SVt_PVAV)
+ croak("formats is not a reference to a list");
+
len = av_len(av)+1;
if (len == 0 || (len & 1) != 0)
croak("formats list is invalid - not divisible by 2 (%d)", len);