mirror of
https://github.com/mirror/wget.git
synced 2025-02-06 09:40:24 +08:00
* src/ftp-ls.c (eat_carets): Fix heap-buffer-overflow
This commit is contained in:
parent
2b61c46183
commit
7d3da08537
@ -592,7 +592,6 @@ static void eat_carets( char *str)
|
||||
char *strd; /* Destination pointer. */
|
||||
char hdgt;
|
||||
unsigned char uchr;
|
||||
unsigned char prop;
|
||||
|
||||
/* Skip ahead to the first "^", if any. */
|
||||
while ((*str != '\0') && (*str != '^'))
|
||||
@ -609,11 +608,10 @@ static void eat_carets( char *str)
|
||||
if (uchr == '^')
|
||||
{
|
||||
/* Found a caret. Skip it, and check the next character. */
|
||||
uchr = *(++str);
|
||||
prop = char_prop[ uchr];
|
||||
if (prop& 64)
|
||||
if ((char_prop[(unsigned char) str[0]] & 64) && (char_prop[(unsigned char) str[1]] & 64))
|
||||
{
|
||||
/* Hex digit. Get char code from this and next hex digit. */
|
||||
uchr = *(++str);
|
||||
if (uchr <= '9')
|
||||
{
|
||||
hdgt = uchr- '0'; /* '0' - '9' -> 0 - 9. */
|
||||
|
Loading…
Reference in New Issue
Block a user