diff libpurple/plugins/perl/common/Status.xs @ 24688:08b65145276a

Fix off-by-ones in the perl loader where av_len is used. Fixes #7687. committer: John Bailey <rekkanoryo@rekkanoryo.org>
author Paul Aurich <paul@darkrain42.org>
date Thu, 11 Dec 2008 06:38:23 +0000
parents 907f5f41e32a
children 7fd6e5a72bf1 68a90c95b722
line wrap: on
line diff
--- a/libpurple/plugins/perl/common/Status.xs	Thu Dec 11 06:32:05 2008 +0000
+++ b/libpurple/plugins/perl/common/Status.xs	Thu Dec 11 06:38:23 2008 +0000
@@ -83,7 +83,7 @@
 	int i, t_len;
 PPCODE:
 	t_GL = NULL;
-	t_len = av_len((AV *)SvRV(source_list));
+	t_len = av_len((AV *)SvRV(source_list)) + 1;
 
 	for (i = 0; i < t_len; i++) {
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(source_list), i, 0)));
@@ -379,7 +379,7 @@
 	int i, t_len;
 CODE:
 	t_GL = NULL;
-	t_len = av_len((AV *)SvRV(status_types));
+	t_len = av_len((AV *)SvRV(status_types)) + 1;
 
 	for (i = 0; i < t_len; i++) {
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(status_types), i, 0)));