summaryrefslogtreecommitdiff
path: root/navit/speech
diff options
context:
space:
mode:
authorgreg <code@gregorkopf.de>2015-07-21 20:05:06 +0200
committergreg <code@gregorkopf.de>2015-07-21 20:08:05 +0200
commit989fa424912d3a09b273a66bc316eb7695291f4c (patch)
tree0482bd8ca368325d36d2f06a520652529d1acb17 /navit/speech
parent69b41cc757e6af96bb20d2c7fe54655d9d25cd28 (diff)
downloadnavit-989fa424912d3a09b273a66bc316eb7695291f4c.tar.gz
Fix a segfault when sample_dir cannot be opened
Diffstat (limited to 'navit/speech')
-rw-r--r--navit/speech/cmdline/speech_cmdline.c4
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))) {