Browse Source

fix out-of-bounds copy

master
Reece Dunn 14 years ago
parent
commit
ae29514eee
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/dictionary.cpp

+ 2
- 2
src/dictionary.cpp View File

const char *word_end; const char *word_end;
const char *word1; const char *word1;
int wflags = 0; int wflags = 0;
char word_buf[N_WORD_BYTES];
char word_buf[N_WORD_BYTES + 1] = {0};


if(wtab != NULL) if(wtab != NULL)
{ {
word1 = word; word1 = word;
if(tr->transpose_min > 0) if(tr->transpose_min > 0)
{ {
strcpy(word_buf,word);
strncpy(word_buf,word, N_WORD_BYTES);
wlen = TransposeAlphabet(tr, word_buf); wlen = TransposeAlphabet(tr, word_buf);
word = word_buf; word = word_buf;
} }

Loading…
Cancel
Save