Skip to content

Commit

Permalink
Merge pull request #6 from greg42/trunk
Browse files Browse the repository at this point in the history
Fix a segfault when sample_dir cannot be opened
  • Loading branch information
pgrandin committed Aug 8, 2015
2 parents 4be9aaf + 989fa42 commit dadf3d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions navit/speech/cmdline/speech_cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down

0 comments on commit dadf3d2

Please sign in to comment.