[srvx-commits] CVS: services/src tools.c,1.73.2.27,1.73.2.28
Brought to you by:
entrope
From: Entrope <en...@us...> - 2001-09-26 03:03:14
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv17800/src Modified Files: Tag: rel-1_0 tools.c Log Message: don't overrun a channel's key buffer Index: tools.c =================================================================== RCS file: /cvsroot/srvx/services/src/tools.c,v retrieving revision 1.73.2.27 retrieving revision 1.73.2.28 diff -C2 -r1.73.2.27 -r1.73.2.28 *** tools.c 2001/09/10 19:11:49 1.73.2.27 --- tools.c 2001/09/26 03:03:12 1.73.2.28 *************** *** 183,187 **** void mod_chanmode(struct chanNode *channel, const char *mode_change, char *key, int limit) { ! int add = 1, n; const char *word = mode_change; --- 183,187 ---- void mod_chanmode(struct chanNode *channel, const char *mode_change, char *key, int limit) { ! int add = 1; const char *word = mode_change; *************** *** 213,220 **** else { ! for (n=0; *word != ' ' && *word; n++) { channel->key[n] = *word++; } - channel->key[n] = 0; } --- 213,220 ---- else { ! unsigned int n; ! for (n=0; (*word != ' ' && *word) && (n < sizeof(channel->key)-1); n++) { channel->key[n] = *word++; } channel->key[n] = 0; } |