mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
Fix undefined behavior due to modifying PL_na twice between sequence points.
Patch by Lukas Mai. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4960 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
20c362a93d
commit
7982a86420
@ -433,9 +433,9 @@ static void perl_signal_remove_list_one(GSList **siglist, PERL_SIGNAL_REC *rec)
|
||||
perl_signal_destroy(rec);
|
||||
}
|
||||
|
||||
#define sv_func_cmp(f1, f2, len) \
|
||||
#define sv_func_cmp(f1, f2) \
|
||||
(f1 == f2 || (SvPOK(f1) && SvPOK(f2) && \
|
||||
strcmp((char *) SvPV(f1, len), (char *) SvPV(f2, len)) == 0))
|
||||
strcmp((char *) SvPV_nolen(f1), (char *) SvPV_nolen(f2)) == 0))
|
||||
|
||||
static void perl_signal_remove_list(GSList **list, SV *func)
|
||||
{
|
||||
@ -444,7 +444,7 @@ static void perl_signal_remove_list(GSList **list, SV *func)
|
||||
for (tmp = *list; tmp != NULL; tmp = tmp->next) {
|
||||
PERL_SIGNAL_REC *rec = tmp->data;
|
||||
|
||||
if (sv_func_cmp(rec->func, func, PL_na)) {
|
||||
if (sv_func_cmp(rec->func, func)) {
|
||||
perl_signal_remove_list_one(list, rec);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user