diff options
Diffstat (limited to 'dev-libs/libchewing/files/0.3.3-strncat-fix.patch')
-rw-r--r-- | dev-libs/libchewing/files/0.3.3-strncat-fix.patch | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dev-libs/libchewing/files/0.3.3-strncat-fix.patch b/dev-libs/libchewing/files/0.3.3-strncat-fix.patch new file mode 100644 index 000000000000..8f2676c0c2b7 --- /dev/null +++ b/dev-libs/libchewing/files/0.3.3-strncat-fix.patch @@ -0,0 +1,13 @@ +diff --git a/src/tree.c b/src/tree.c +index 7e8f665..89ad0d5 100644 +--- a/src/tree.c ++++ b/src/tree.c +@@ -586,7 +586,7 @@ static void LoadChar( char *buf, int buf_len, uint16 phoneSeq[], int nPhoneSeq ) + memset(buf, 0, buf_len); + for ( i = 0; i < nPhoneSeq; i++ ) { + GetCharFirst( &word, phoneSeq[ i ] ); +- strncat(buf, word.word, buf_len); ++ strncat(buf, word.word, buf_len - strlen(buf) - 1); + } + buf[ buf_len - 1 ] = '\0'; + } |