summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2011-07-22 21:10:05 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2011-07-22 21:10:05 (GMT)
commite503a7f56ca38efc1886e04be0dbeb380db3934a (patch) (side-by-side diff)
treefc3473d3e233bc8bd3c2923335676bfb477d88ef
parent69751df3b8f70a6e62f497a8870d81d5d1e14aa4 (diff)
downloadidest-e503a7f56ca38efc1886e04be0dbeb380db3934a.tar.gz
idest-e503a7f56ca38efc1886e04be0dbeb380db3934a.tar.bz2
Bugfixes
* src/cmdline.opt (get_options): Prevent coredump on argc==optind. * src/guile.c (flush_user_load_path): Prevent coredump on user_load_path_list == NULL.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/cmdline.opt2
-rw-r--r--src/guile.c20
2 files changed, 12 insertions, 10 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt
index 3fc84e4..9ba0e81 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -224,7 +224,7 @@ void
get_options(int argc, char *argv[])
{
GETOPT(argc, argv)
- if (mode == MODE_MOD) {
+ if (optind < argc && mode == MODE_MOD) {
char *p;
/* See if we've been given any assignment arguments */
while (p = strchr(argv[optind], '=')) {
diff --git a/src/guile.c b/src/guile.c
index 08baf00..b4339c3 100644
--- a/src/guile.c
+++ b/src/guile.c
@@ -606,15 +606,17 @@ guile_add_load_path(const char *arg)
static void
flush_user_load_path()
{
- gl_list_iterator_t itr;
- const void *p;
-
- itr = gl_list_iterator(user_load_path_list);
- while (gl_list_iterator_next(&itr, &p, NULL))
- load_path_prepend(p);
- gl_list_iterator_free(&itr);
- gl_list_free(user_load_path_list);
- user_load_path_list = NULL;
+ if (user_load_path_list) {
+ gl_list_iterator_t itr;
+ const void *p;
+
+ itr = gl_list_iterator(user_load_path_list);
+ while (gl_list_iterator_next(&itr, &p, NULL))
+ load_path_prepend(p);
+ gl_list_iterator_free(&itr);
+ gl_list_free(user_load_path_list);
+ user_load_path_list = NULL;
+ }
}
static void

Return to:

Send suggestions and report system problems to the System administrator.