[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A bug report in patch utility.
From: |
Sung Kwan Kang |
Subject: |
A bug report in patch utility. |
Date: |
Tue, 8 Apr 2003 14:25:00 -0700 |
To whom it may concern,
Hello, I think I found a bug in GNU patch, specifically in
patch-2.5.4.tar.gz package. When patching a file it kept crashing with
'Segmentation Fault', and I figured out that the following code in line
794 in partime.c was problematic:
...
while (!ISALNUM ((unsigned char) *s))
...
Which should read:
...
while (!ISALNUM ((unsigned char) *s) && *s)
...
Just like similar other codes in the same file. It was processing the
output of 'diff -c' and encountered timestamp string such as:
*** foobar.cpp 2003-04-01 16:24:33.000000000 -0800
--- ../foobar.cpp 2003-04-07 16:34:05.000000000 -0700
...
And that piece of code was expecting some alphanumeric token after
"-0800" string, which never occurs. So the pointer went out of bound
without stopping unless there happens to be an alphanumeric character
in that range.
Please review this finding. I attached patch file for my fix.
Thanks,
SungKwan Kang
<<patch.txt>>
patch.txt
Description: patch.txt
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- A bug report in patch utility.,
Sung Kwan Kang <=