2006-04-11 11:11:32 -04:00
|
|
|
$OpenBSD: patch-conf_c,v 1.3 2006/04/11 15:11:33 naddy Exp $
|
|
|
|
--- conf.c.orig Thu Feb 24 02:47:58 2005
|
|
|
|
+++ conf.c Tue Nov 1 21:50:32 2005
|
|
|
|
@@ -129,9 +129,10 @@ conf_t *conf_load( int argc, char *argv[
|
2004-06-20 12:27:49 -04:00
|
|
|
|
|
|
|
if( conf->configdir[strlen(conf->configdir)-1] != '/' )
|
|
|
|
{
|
2006-04-11 11:11:32 -04:00
|
|
|
- char *s = g_new( char, strlen( conf->configdir ) + 2 );
|
|
|
|
+ size_t s_len = strlen( conf->configdir ) + 2;
|
|
|
|
+ char *s = g_new( char, s_len);
|
2004-06-20 12:27:49 -04:00
|
|
|
|
|
|
|
- sprintf( s, "%s/", conf->configdir );
|
|
|
|
+ g_snprintf( s, s_len, "%s/", conf->configdir );
|
|
|
|
g_free( conf->configdir );
|
|
|
|
conf->configdir = s;
|
|
|
|
}
|
2006-04-11 11:11:32 -04:00
|
|
|
@@ -226,9 +227,9 @@ static int conf_loadini( conf_t *conf, c
|
|
|
|
return( 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
- strncpy( proxyhost, url->host, sizeof( proxyhost ) );
|
|
|
|
- strncpy( proxyuser, url->user, sizeof( proxyuser ) );
|
|
|
|
- strncpy( proxypass, url->pass, sizeof( proxypass ) );
|
|
|
|
+ strlcpy( proxyhost, url->host, sizeof( proxyhost ) );
|
|
|
|
+ strlcpy( proxyuser, url->user, sizeof( proxyuser ) );
|
|
|
|
+ strlcpy( proxypass, url->pass, sizeof( proxypass ) );
|
|
|
|
proxyport = url->port;
|
|
|
|
if( url->proto == PROTO_HTTP )
|
|
|
|
proxytype = PROXY_HTTP;
|