mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05: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:
parent
d74c9788b7
commit
8e48c6c36a
@ -90,8 +90,12 @@ PREINIT:
|
|||||||
CODE:
|
CODE:
|
||||||
|
|
||||||
if (!SvROK(formats))
|
if (!SvROK(formats))
|
||||||
croak("formats is not a reference to list");
|
croak("formats is not a reference");
|
||||||
|
|
||||||
av = (AV *) SvRV(formats);
|
av = (AV *) SvRV(formats);
|
||||||
|
if (SvTYPE(av) != SVt_PVAV)
|
||||||
|
croak("formats is not a reference to a list");
|
||||||
|
|
||||||
len = av_len(av)+1;
|
len = av_len(av)+1;
|
||||||
if (len == 0 || (len & 1) != 0)
|
if (len == 0 || (len & 1) != 0)
|
||||||
croak("formats list is invalid - not divisible by 2 (%d)", len);
|
croak("formats list is invalid - not divisible by 2 (%d)", len);
|
||||||
|
Loading…
Reference in New Issue
Block a user