projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Point out that the SourceForge messaging system works like a blackhole and should...
[privoxy.git]
/
loadcfg.c
diff --git
a/loadcfg.c
b/loadcfg.c
index
5f88d75
..
899e430
100644
(file)
--- a/
loadcfg.c
+++ b/
loadcfg.c
@@
-1,4
+1,4
@@
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.1
08 2010/01/03 12:37:14 fabiankeil
Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.1
11 2010/08/14 23:28:52 ler762
Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
@@
-248,11
+248,6
@@
static void unload_configfile (void * data)
list_remove_all(config->trust_info);
#endif /* def FEATURE_TRUST */
list_remove_all(config->trust_info);
#endif /* def FEATURE_TRUST */
- for (i = 0; i < MAX_AF_FILES; i++)
- {
- freez(config->re_filterfile[i]);
- }
-
freez(config);
}
freez(config);
}
@@
-297,7
+292,7
@@
void unload_current_config_file(void)
*********************************************************************/
struct configuration_spec * load_config(void)
{
*********************************************************************/
struct configuration_spec * load_config(void)
{
- char
buf[BUFFER_SIZE]
;
+ char
*buf = NULL
;
char *p, *q;
FILE *configfp = NULL;
struct configuration_spec * config = NULL;
char *p, *q;
FILE *configfp = NULL;
struct configuration_spec * config = NULL;
@@
-378,7
+373,7
@@
struct configuration_spec * load_config(void)
/* Never get here - LOG_LEVEL_FATAL causes program exit */
}
/* Never get here - LOG_LEVEL_FATAL causes program exit */
}
- while (read_config_line(
buf, sizeof(buf), configfp, &linenum
) != NULL)
+ while (read_config_line(
configfp, &linenum, &buf
) != NULL)
{
char cmd[BUFFER_SIZE];
char arg[BUFFER_SIZE];
{
char cmd[BUFFER_SIZE];
char arg[BUFFER_SIZE];
@@
-409,11
+404,15
@@
struct configuration_spec * load_config(void)
}
/* Copy the argument into arg */
}
/* Copy the argument into arg */
- strlcpy(arg, p, sizeof(arg));
+ if (strlcpy(arg, p, sizeof(arg)) >= sizeof(arg))
+ {
+ log_error(LOG_LEVEL_FATAL, "Config line too long: %s", buf);
+ }
/* Should never happen, but check this anyway */
if (*cmd == '\0')
{
/* Should never happen, but check this anyway */
if (*cmd == '\0')
{
+ freez(buf);
continue;
}
continue;
}
@@
-1344,7
+1343,7
@@
struct configuration_spec * load_config(void)
/* Save the argument for the show-status page. */
savearg(cmd, arg, config);
/* Save the argument for the show-status page. */
savearg(cmd, arg, config);
-
+ freez(buf);
} /* end while ( read_config_line(...) ) */
fclose(configfp);
} /* end while ( read_config_line(...) ) */
fclose(configfp);
@@
-1484,8
+1483,9
@@
struct configuration_spec * load_config(void)
#if defined(_WIN32) && !defined (_WIN_CONSOLE)
g_default_actions_file = config->actions_file[1]; /* FIXME Hope this is default.action */
#if defined(_WIN32) && !defined (_WIN_CONSOLE)
g_default_actions_file = config->actions_file[1]; /* FIXME Hope this is default.action */
- g_user_actions_file = config->actions_file[2]; /* FIXME Hope this is user.action */
- g_re_filterfile = config->re_filterfile[0]; /* FIXME Hope this is default.filter */
+ g_user_actions_file = config->actions_file[2]; /* FIXME Hope this is user.action */
+ g_default_filterfile = config->re_filterfile[0]; /* FIXME Hope this is default.filter */
+ g_user_filterfile = config->re_filterfile[1]; /* FIXME Hope this is user.filter */
#ifdef FEATURE_TRUST
g_trustfile = config->trustfile;
#ifdef FEATURE_TRUST
g_trustfile = config->trustfile;