Browse Source

Make strcpy calls in load dictionary copy at most 40 bytes so clang __strcpy_check does not get triggered (possible buffer overflow?)

master
Rui Batista 8 years ago
parent
commit
7b82e39793
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/libespeak-ng/dictionary.c

+ 2
- 2
src/libespeak-ng/dictionary.c View File

unsigned int size; unsigned int size;
char fname[sizeof(path_home)+20]; char fname[sizeof(path_home)+20];


strcpy(dictionary_name, name); // currently loaded dictionary name
strcpy(tr->dictionary_name, name);
strncpy(dictionary_name, name, 40); // currently loaded dictionary name
strncpy(tr->dictionary_name, name, 40);


// Load a pronunciation data file into memory // Load a pronunciation data file into memory
// bytes 0-3: offset to rules data // bytes 0-3: offset to rules data

Loading…
Cancel
Save