1
1

* man2hlp.c (handle_command): Fix possible buffer overflow.

(handle_link): Likewise.
Этот коммит содержится в:
Andrew V. Samoilov 2003-01-15 14:20:01 +00:00
родитель 483d470073
Коммит 49b5356345

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

@ -578,10 +578,9 @@ handle_command (char *buffer)
return;
} else {
/* Other commands are ignored */
/* There is no memmove on some systems */
char warn_str[BUFFER_SIZE];
strcpy (warn_str, "Warning: unsupported command ");
strncat (warn_str, buffer, sizeof (warn_str));
g_snprintf (warn_str, sizeof (warn_str),
"Warning: unsupported command %s", buffer);
print_error (warn_str);
return;
}
@ -610,7 +609,8 @@ handle_link (char *buffer)
/* Bold text or italics text */
if (buffer[0] == '.' && (buffer[1] == 'I' || buffer[1] == 'B'))
for (buffer += 2; *buffer == ' ' || *buffer == '\t'; buffer++);
strcpy (old, buffer);
strncpy (old, buffer, sizeof (old) - 1);
old[sizeof (old) - 1] = 0;
link_flag = 3;
break;
case 3: