1
0
mirror of https://github.com/irssi/irssi.git synced 2025-02-02 15:08:01 -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:
Emanuele Giaquinta 2008-12-09 18:16:49 +00:00 committed by exg
parent 20c362a93d
commit 7982a86420

View File

@ -433,9 +433,9 @@ static void perl_signal_remove_list_one(GSList **siglist, PERL_SIGNAL_REC *rec)
perl_signal_destroy(rec); perl_signal_destroy(rec);
} }
#define sv_func_cmp(f1, f2, len) \ #define sv_func_cmp(f1, f2) \
(f1 == f2 || (SvPOK(f1) && SvPOK(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) 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) { for (tmp = *list; tmp != NULL; tmp = tmp->next) {
PERL_SIGNAL_REC *rec = tmp->data; 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); perl_signal_remove_list_one(list, rec);
break; break;
} }