[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/modules/icq-toc/libtoc libtoc.c,1.7,1.8
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/modules/icq-toc/libtoc libtoc.c,1.7,1.8 |
Date: |
Tue, 25 Mar 2003 18:29:27 -0500 |
Update of /cvsroot/ayttm/ayttm/modules/icq-toc/libtoc
In directory subversions:/tmp/cvs-serv17844/modules/icq-toc/libtoc
Modified Files:
libtoc.c
Log Message:
strcpy/strncpy, strcat/strncat, sprintf/snprintf
Index: libtoc.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/icq-toc/libtoc/libtoc.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- libtoc.c 25 Mar 2003 17:22:48 -0000 1.7
+++ libtoc.c 25 Mar 2003 23:29:25 -0000 1.8
@@ -383,7 +383,7 @@
int x;
strcpy(rp, "0x");
for (x=0;(x<150) && pass[x]; x++)
- pos+=sprintf(&rp[pos],"%02x", pass[x] ^ roast[x %
strlen(roast)]);
+ pos+=snprintf(&rp[pos], 256, "%02x", pass[x] ^ roast[x %
strlen(roast)]);
rp[pos]='\0';
return rp;
}
@@ -588,7 +588,7 @@
fprintf(stderr, "file_name = %s\n", buff + 186 );
}
memset(buff + 62, 0, 32);
- strcpy(buff + 62, "TIK");
+ strncpy(buff + 62, "TIK", sizeof(buff)-62);
fh->encryption = 0;
fh->compression = 0;
fh->total_num_parts = htons(1);
@@ -785,7 +785,7 @@
{
if(*d == 'g')
{
- strcpy(group, d+2);
+ strncpy(group, d+2, sizeof(group));
icqtoc_new_group(group);
}
else if(*d == 'b')
@@ -1186,7 +1186,7 @@
info=strdup(tinfo);
// end hack (user info)
- strcpy(conn->server, server);
+ strncpy(conn->server, server, sizeof(conn->server));
conn->port = port;
@@ -1351,25 +1351,25 @@
buff[0] = '\0';
strcat(buff, "g:");
- strcat(buff, group);
- strcat(buff, "\n");
+ strncat(buff, group, sizeof(buff)-strlen(buff));
+ strncat(buff, "\n", sizeof(buff)-strlen(buff));
for( node = list; node; node=node->next )
{
char * handle = node->data;
- strcat( buff, "b:");
- strcat( buff, icq_normalize(handle) );
- strcat( buff, "\n");
+ strncat( buff, "b:", sizeof(buff)-strlen(buff));
+ strncat( buff, icq_normalize(handle),
sizeof(buff)-strlen(buff));
+ strncat( buff, "\n", sizeof(buff)-strlen(buff));
if(strlen(buff) > 100 )
{
g_snprintf(buff2, 2048, "toc2_new_buddies {%s}", buff);
send_flap(conn, DATA, buff2);
buff[0] = '\0';
- strcat(buff, "g:");
- strcat(buff, group);
- strcat(buff, "\n");
+ strncat(buff, "g:", sizeof(buff)-strlen(buff));
+ strncat(buff, group, sizeof(buff)-strlen(buff));
+ strncat(buff, "\n", sizeof(buff)-strlen(buff));
}
}
@@ -1397,7 +1397,7 @@
char buff[2048];
g_snprintf(buff, 2048, "toc_get_info %s", icq_normalize(user));
- strcpy(user_info_id, user);
+ strncpy(user_info_id, user, sizeof(user_info_id));
send_flap(conn, DATA, buff);
}
@@ -1406,10 +1406,10 @@
char buff[2048];
char buff2[2048];
- strcpy(buff2, icq_normalize(user));
+ strncpy(buff2, icq_normalize(user), sizeof(buff2));
g_snprintf(buff, 2048, "toc2_remove_buddy %s \"%s\"", buff2, group);
- strcpy(user_info_id, user);
+ strncpy(user_info_id, user, sizeof(user_info_id));
send_flap(conn, DATA, buff);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/modules/icq-toc/libtoc libtoc.c,1.7,1.8,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm/src account.c,1.17,1.18 account_parser.y,1.6,1.7 chat_room.c,1.58,1.59 chat_window.c,1.65,1.66 contact_actions.c,1.8,1.9 contact_parser.y,1.10,1.11 log_window.c,1.22,1.23 main.c,1.26,1.27 offline_queue_mgmt.c,1.12,1.13 prefs.c,1.31,1.32 prefs_window.c,1.11,1.12 smileys.c,1.18,1.19 speech.c,1.5,1.6 trigger.c,1.13,1.14 util.c,1.61,1.62
- Next by Date:
[Ayttm-commits] CVS: ayttm/modules/aim-toc/libtoc libtoc.c,1.9,1.10
- Previous by thread:
[Ayttm-commits] CVS: ayttm/src account.c,1.17,1.18 account_parser.y,1.6,1.7 chat_room.c,1.58,1.59 chat_window.c,1.65,1.66 contact_actions.c,1.8,1.9 contact_parser.y,1.10,1.11 log_window.c,1.22,1.23 main.c,1.26,1.27 offline_queue_mgmt.c,1.12,1.13 prefs.c,1.31,1.32 prefs_window.c,1.11,1.12 smileys.c,1.18,1.19 speech.c,1.5,1.6 trigger.c,1.13,1.14 util.c,1.61,1.62
- Next by thread:
[Ayttm-commits] CVS: ayttm/modules/aim-toc/libtoc libtoc.c,1.9,1.10
- Index(es):