OSDN Git Service
(root)
/
chasen-legacy
/
chasen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a441e4
)
Added length check in chasen_sparse_main.
2.4.4-security-fix
author
NOKUBI Takatsugu
<knok@daionet.gr.jp>
Tue, 22 Nov 2011 18:56:45 +0000
(18:56 +0000)
committer
NOKUBI Takatsugu
<knok@daionet.gr.jp>
Thu, 24 Nov 2011 01:36:29 +0000
(
01:36
+0000)
lib/chalib.c
patch
|
blob
|
history
diff --git
a/lib/chalib.c
b/lib/chalib.c
index
5d79e13
..
cddf51b
100644
(file)
--- a/
lib/chalib.c
+++ b/
lib/chalib.c
@@
-306,9
+306,14
@@
chasen_sparse_main(char *input, FILE *output)
*/
while (*input) {
int c = 0, len, cursor;
- if ((crlf = strpbrk(input, "\r\n")) == NULL)
+ if ((crlf = strpbrk(input, "\r\n")) == NULL)
{
len = strlen(input);
- else {
+ if (len >= CHA_INPUT_SIZE) {
+ len = CHA_INPUT_SIZE - 1;
+ crlf = input + CHA_INPUT_SIZE - 2;
+ c = 0;
+ }
+ } else {
len = crlf - input;
c = *crlf;
*crlf = '\0';