• R/O
  • HTTP
  • SSH
  • HTTPS

chasen: Commit

The ChaSen legacy source.


Commit MetaInfo

Revisiona65e9d344738f53a79f4325ad967556bb56518bc (tree)
Zeit2012-06-14 16:49:11
AutorNOKUBI Takatsugu <knok@daio...>
CommiterNOKUBI Takatsugu

Log Message

Fix buffer overflow

Ändern Zusammenfassung

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
1+2012-06-14 NOKUBI Takatsugu <knok@daionet.gr.jp>
2+
3+ * lib/chalib.c (chasen_sparse_main):
4+ fix buffer overflow
5+ JVN#16901583 https://jvn.jp/jp/JVN16901583/index.html
6+
17 2007-07-23 Asahara Masayuki <masayu-a@is.naist.jp>
28
39 * lib/tokenizer.c (cha_tok_parse):
--- a/lib/chalib.c
+++ b/lib/chalib.c
@@ -306,9 +306,14 @@ chasen_sparse_main(char *input, FILE *output)
306306 */
307307 while (*input) {
308308 int c = 0, len, cursor;
309- if ((crlf = strpbrk(input, "\r\n")) == NULL)
309+ if ((crlf = strpbrk(input, "\r\n")) == NULL) {
310310 len = strlen(input);
311- else {
311+ if (len >= CHA_INPUT_SIZE) {
312+ len = CHA_INPUT_SIZE - 1;
313+ crlf = input + CHA_INPUT_SIZE - 2;
314+ c = 0;
315+ }
316+ } else {
312317 len = crlf - input;
313318 c = *crlf;
314319 *crlf = '\0';
Show on old repository browser