diff options
author | Pierre GRANDIN <pgrandin@users.noreply.github.com> | 2015-08-08 00:06:03 -0700 |
---|---|---|
committer | Pierre GRANDIN <pgrandin@users.noreply.github.com> | 2015-08-08 00:06:03 -0700 |
commit | dadf3d2f30d350f2e6cfb585e100e9c7928bdbbd (patch) | |
tree | efe4c4916a6339c066f479a16eb3177dfb2409d4 | |
parent | 4be9aafe290f80ac76d185def1937c01a0991f98 (diff) | |
parent | 989fa424912d3a09b273a66bc316eb7695291f4c (diff) | |
download | navit-dadf3d2f30d350f2e6cfb585e100e9c7928bdbbd.tar.gz |
Merge pull request #6 from greg42/trunkv0.5.0-rc.1
Fix a segfault when sample_dir cannot be opened
-rw-r--r-- | navit/speech/cmdline/speech_cmdline.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/navit/speech/cmdline/speech_cmdline.c b/navit/speech/cmdline/speech_cmdline.c index 08a1abe03..49252f346 100644 --- a/navit/speech/cmdline/speech_cmdline.c +++ b/navit/speech/cmdline/speech_cmdline.c @@ -236,6 +236,10 @@ speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *paren this->flags=attr->u.num; if (this->sample_dir && this->sample_suffix) { void *handle=file_opendir(this->sample_dir); + if (!handle) { + dbg(lvl_error,"Cannot read sample directory contents: %s", this->sample_dir); + return NULL; + } char *name; int suffix_len=strlen(this->sample_suffix); while((name=file_readdir(handle))) { |