1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-23 06:35:36 +00:00

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
This commit is contained in:
Emanuele Giaquinta 2012-06-24 09:33:28 +00:00 committed by exg
parent d74c9788b7
commit 8e48c6c36a

View File

@ -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);