diff libpurple/plugins/perl/common/Conversation.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/Conversation.xs	Thu Dec 11 06:32:05 2008 +0000
+++ b/libpurple/plugins/perl/common/Conversation.xs	Thu Dec 11 06:38:23 2008 +0000
@@ -334,7 +334,7 @@
 	int i, t_len;
 PPCODE:
 	t_GL = NULL;
-	t_len = av_len((AV *)SvRV(users));
+	t_len = av_len((AV *)SvRV(users)) + 1;
 
 	for (i = 0; i < t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(users), i, 0)));
@@ -372,7 +372,7 @@
 	int i, t_len;
 PPCODE:
 	t_GL = NULL;
-	t_len = av_len((AV *)SvRV(ignored));
+	t_len = av_len((AV *)SvRV(ignored)) + 1;
 
 	for (i = 0; i < t_len; i++)
 		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(ignored), i, 0)));
@@ -429,19 +429,19 @@
 	int i, t_len;
 PPCODE:
 	t_GL_users = NULL;
-	t_len = av_len((AV *)SvRV(users));
+	t_len = av_len((AV *)SvRV(users)) + 1;
 
 	for (i = 0; i < t_len; i++)
 		t_GL_users = g_list_append(t_GL_users, SvPVutf8_nolen(*av_fetch((AV *)SvRV(users), i, 0)));
 
 	t_GL_flags = NULL;
-	t_len = av_len((AV *)SvRV(flags));
+	t_len = av_len((AV *)SvRV(flags)) + 1;
 
 	for (i = 0; i < t_len; i++)
 		t_GL_flags = g_list_append(t_GL_flags, SvPVutf8_nolen(*av_fetch((AV *)SvRV(flags), i, 0)));
 
 	t_GL_extra_msgs = NULL;
-	t_len = av_len((AV *)SvRV(extra_msgs));
+	t_len = av_len((AV *)SvRV(extra_msgs)) + 1;
 
 	for (i = 0; i < t_len; i++)
 		t_GL_extra_msgs = g_list_append(t_GL_extra_msgs, SvPVutf8_nolen(*av_fetch((AV *)SvRV(extra_msgs), i, 0)));