diff libpurple/protocols/zephyr/ZRetSubs.c @ 32228:5d442ea707b5

Replace numerous strcpy() invocations with strlcpy() in Zephyr. Thanks to the Electronic Frontier Foundation (http://www.eff.org/) for this patch.
author Ethan Blanton <elb@pidgin.im>
date Sun, 17 Jul 2011 03:57:21 +0000
parents a8cc50c2279f
children 680bd9ef2d8f
line wrap: on
line diff
--- a/libpurple/protocols/zephyr/ZRetSubs.c	Sun Jul 17 03:56:39 2011 +0000
+++ b/libpurple/protocols/zephyr/ZRetSubs.c	Sun Jul 17 03:57:21 2011 +0000
@@ -147,7 +147,7 @@
 				ZFreeNotice(&retnotice);
 				return (ENOMEM);
 			}
-			(void) strcpy(__subscriptions_list[i].zsub_class,ptr);
+			g_strlcpy(__subscriptions_list[i].zsub_class,ptr,(unsigned)strlen(ptr));
 			ptr += strlen(ptr)+1;
 			__subscriptions_list[i].zsub_classinst = (char *)
 				malloc((unsigned)strlen(ptr)+1);
@@ -155,7 +155,7 @@
 				ZFreeNotice(&retnotice);
 				return (ENOMEM);
 			}
-			(void) strcpy(__subscriptions_list[i].zsub_classinst,ptr);
+			g_strlcpy(__subscriptions_list[i].zsub_classinst,ptr,(unsigned)strlen(ptr));
 			ptr += strlen(ptr)+1;
 			ptr2 = ptr;
 			if (!*ptr2)
@@ -166,7 +166,7 @@
 				ZFreeNotice(&retnotice);
 				return (ENOMEM);
 			}
-			(void) strcpy(__subscriptions_list[i].zsub_recipient,ptr2);
+			g_strlcpy(__subscriptions_list[i].zsub_recipient,ptr2,(unsigned)strlen(ptr2));
 			ptr += strlen(ptr)+1;
 		}
 		ZFreeNotice(&retnotice);