diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2011-10-30 12:33:49 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2011-10-30 12:33:49 +0100 |
commit | de26f3ccb7148d83c7bb8a6d5b84bccc95d765fa (patch) | |
tree | c497ba0ed1b43684c128d2220016b02024547543 | |
parent | e6b41b1db86aded510fa413d3ab1c34e624c9c27 (diff) |
Killed careless use of strcpy(). Luckily these are only a risk on public
servers.
-rw-r--r-- | protocols/jabber/s5bytestream.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/jabber/s5bytestream.c b/protocols/jabber/s5bytestream.c index 3304d99e..f4618cef 100644 --- a/protocols/jabber/s5bytestream.c +++ b/protocols/jabber/s5bytestream.c @@ -876,7 +876,8 @@ jabber_streamhost_t *jabber_si_parse_proxy( struct im_connection *ic, char *prox jabber_streamhost_t *sh; if( ( ( host = strchr( proxy, ',' ) ) == 0 ) || - ( ( port = strchr( host+1, ',' ) ) == 0 ) ) { + ( ( port = strchr( host+1, ',' ) ) == 0 ) ) + { imcb_log( ic, "Error parsing proxy setting: \"%s\" (ignored)", proxy ); return NULL; } @@ -888,7 +889,7 @@ jabber_streamhost_t *jabber_si_parse_proxy( struct im_connection *ic, char *prox sh = g_new0( jabber_streamhost_t, 1 ); sh->jid = g_strdup( jid ); sh->host = g_strdup( host ); - strcpy( sh->port, port ); + g_snprintf( sh->port, sizeof( sh->port ), "%s", port ); return sh; } @@ -914,7 +915,7 @@ void jabber_si_set_proxies( struct bs_transfer *bt ) sh = g_new0( jabber_streamhost_t, 1 ); sh->jid = g_strdup( tf->ini_jid ); sh->host = g_strdup( host ); - strcpy( sh->port, port ); + g_snprintf( sh->port, sizeof( sh->port ), "%s", port ); bt->streamhosts = g_slist_append( bt->streamhosts, sh ); bt->tf->watch_in = b_input_add( tf->fd, B_EV_IO_READ, jabber_bs_send_handshake, bt ); |