--- a/libpurple/protocols/zephyr/ZAsyncLocate.c Sun Jul 17 03:57:21 2011 +0000
+++ b/libpurple/protocols/zephyr/ZAsyncLocate.c Sun Jul 17 17:17:19 2011 +0000
@@ -18,6 +18,7 @@
+ size_t userlen, versionlen; if ((retval = ZOpenPort((unsigned short *)0)) != ZERR_NONE)
@@ -37,16 +38,18 @@
if ((retval = ZSendNotice(¬ice, auth)) != ZERR_NONE)
- if ((zald->user = (char *) malloc(strlen(user)+1)) == NULL) {
+ userlen = strlen(user) + 1; + versionlen = strlen(notice.z_version) + 1; + if ((zald->user = (char *) malloc(userlen)) == NULL) { - if ((zald->version = (char *) malloc(strlen(notice.z_version)+1)) == NULL) {
+ if ((zald->version = (char *) malloc(versionlen)) == NULL) { zald->uid = notice.z_multiuid;
- g_strlcpy(zald->user,user,strlen(user)+1);
- g_strlcpy(zald->version,notice.z_version,strlen(notice.z_version)+1);
+ g_strlcpy(zald->user,user,userlen); + g_strlcpy(zald->version,notice.z_version,versionlen); @@ -130,14 +133,17 @@
- if ((*user = (char *) malloc(strlen(zald->user)+1)) == NULL)
+ len = strlen(zald->user) + 1; + if ((*user = (char *) malloc(len)) == NULL) - g_strlcpy(*user,zald->user,strlen(zald->user)+1);
+ g_strlcpy(*user,zald->user,len); - if ((*user = (char *) malloc(strlen(notice->z_class_inst)+1)) == NULL)
+ len = strlen(notice->z_class_inst) + 1; + if ((*user = (char *) malloc(len)) == NULL) - g_strlcpy(*user,notice->z_class_inst,strlen(notice->z_class_inst)+1);
+ g_strlcpy(*user,notice->z_class_inst,len); --- a/libpurple/protocols/zephyr/ZInit.c Sun Jul 17 03:57:21 2011 +0000
+++ b/libpurple/protocols/zephyr/ZInit.c Sun Jul 17 17:17:19 2011 +0000
@@ -101,7 +101,7 @@
#ifdef ZEPHYR_USES_KERBEROS
- g_strlcpy(__Zephyr_realm, krealm, REALM_SZ-1);
+ g_strlcpy(__Zephyr_realm, krealm, REALM_SZ); } else if ((krb_get_tf_fullname(TKT_FILE, d1, d2, __Zephyr_realm)
((krbval = krb_get_lrealm(__Zephyr_realm, 1)) != KSUCCESS)) {
--- a/libpurple/protocols/zephyr/ZRetSubs.c Sun Jul 17 03:57:21 2011 +0000
+++ b/libpurple/protocols/zephyr/ZRetSubs.c Sun Jul 17 17:17:19 2011 +0000
@@ -141,32 +141,37 @@
for (ptr=retnotice.z_message,i = 0; i< __subscriptions_num; i++) {
__subscriptions_list[i].zsub_class = (char *)
- malloc((unsigned)strlen(ptr)+1);
if (!__subscriptions_list[i].zsub_class) {
- g_strlcpy(__subscriptions_list[i].zsub_class,ptr,(unsigned)strlen(ptr));
+ g_strlcpy(__subscriptions_list[i].zsub_class,ptr,len); __subscriptions_list[i].zsub_classinst = (char *)
- malloc((unsigned)strlen(ptr)+1);
if (!__subscriptions_list[i].zsub_classinst) {
- g_strlcpy(__subscriptions_list[i].zsub_classinst,ptr,(unsigned)strlen(ptr));
+ g_strlcpy(__subscriptions_list[i].zsub_classinst,ptr,len); + len = strlen(ptr2) + 1; __subscriptions_list[i].zsub_recipient = (char *)
- malloc((unsigned)strlen(ptr2)+1);
if (!__subscriptions_list[i].zsub_recipient) {
- g_strlcpy(__subscriptions_list[i].zsub_recipient,ptr2,(unsigned)strlen(ptr2));
+ g_strlcpy(__subscriptions_list[i].zsub_recipient,ptr2,len);