From 8e48c6c36ac8ee6d58348aa898c6f13d1f9c45b6 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Sun, 24 Jun 2012 09:33:28 +0000 Subject: 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 --- src/perl/ui/Themes.xs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3