a2c69a5b0d
Partial audit for string handling. From: Andrew Dalgleish <openbsd@ajd.net.au>
17 lines
589 B
Plaintext
17 lines
589 B
Plaintext
$OpenBSD: patch-conf_c,v 1.1 2004/06/20 16:27:49 naddy Exp $
|
|
--- conf.c.orig 2004-04-05 06:50:52.000000000 +1000
|
|
+++ conf.c 2004-06-09 21:17:00.000000000 +1000
|
|
@@ -131,9 +131,10 @@ conf_t *conf_load( int argc, char *argv[
|
|
|
|
if( conf->configdir[strlen(conf->configdir)-1] != '/' )
|
|
{
|
|
- char *s = bitlbee_alloc( strlen( conf->configdir ) + 2 );
|
|
+ size_t s_len = strlen( conf->configdir ) + 2 ;
|
|
+ char *s = bitlbee_alloc( s_len );
|
|
|
|
- sprintf( s, "%s/", conf->configdir );
|
|
+ g_snprintf( s, s_len, "%s/", conf->configdir );
|
|
g_free( conf->configdir );
|
|
conf->configdir = s;
|
|
}
|