1
1

* ext.c (regex_command): Additional check to prevent reading

unallocated memory when matching "shell/".  Found by Valgrind.
Этот коммит содержится в:
Pavel Roskin 2002-07-30 05:39:48 +00:00
родитель bda707e46b
Коммит b698076e0e
2 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,8 @@
2002-07-30 Pavel Roskin <proski@gnu.org>
* ext.c (regex_command): Additional check to prevent reading
unallocated memory when matching "shell/". Found by Valgrind.
2002-07-29 Pavel Roskin <proski@gnu.org>
* setup.c: Eliminate all PORT* macros.

Просмотреть файл

@ -472,9 +472,9 @@ file as an example of how to write it.\n\
found = 1;
} else if (!strncmp (p, "shell/", 6)) {
p += 6;
if (*p == '.') {
if (!strncmp (p, filename + file_len - (q - p),
q - p))
if (*p == '.' && file_len >= (q - p)) {
if (file_len >= (q - p) &&
!strncmp (p, filename + file_len - (q - p), q - p))
found = 1;
} else {
if (q - p == file_len && !strncmp (p, filename, q - p))