Prevent overflow beyond the end of string in caller of get_mclen()
Bug-Debian: https://github.com/tats/w3m/issues/59 Bug-Debian: https://github.com/tats/w3m/issues/73 Bug-Debian: https://github.com/tats/w3m/issues/74 Bug-Debian: https://github.com/tats/w3m/issues/76 Bug-Debian: https://github.com/tats/w3m/issues/79 Bug-Debian: https://github.com/tats/w3m/issues/80 Bug-Debian: https://github.com/tats/w3m/issues/83 Bug-Debian: https://github.com/tats/w3m/issues/84
This commit is contained in:
11
libwc/wtf.c
11
libwc/wtf.c
@@ -129,13 +129,18 @@ wtf_strwidth(wc_uchar *p)
|
||||
return w;
|
||||
}
|
||||
|
||||
/*
|
||||
size_t
|
||||
wtf_len1(wc_uchar *p)
|
||||
{
|
||||
return (size_t)WTF_LEN_MAP[*p];
|
||||
size_t len, len_max = WTF_LEN_MAP[*p];
|
||||
|
||||
for (len = 0; *(p + len); len++)
|
||||
if (len == len_max)
|
||||
break;
|
||||
if (len == 0)
|
||||
len = 1;
|
||||
return len;
|
||||
}
|
||||
*/
|
||||
|
||||
size_t
|
||||
wtf_len(wc_uchar *p)
|
||||
|
Reference in New Issue
Block a user