Prevent overflow beyond the end of string in visible_length()
Bug-Debian: https://github.com/tats/w3m/issues/73
This commit is contained in:
@@ -428,8 +428,9 @@ visible_length(char *str)
|
|||||||
Str tagbuf = Strnew();
|
Str tagbuf = Strnew();
|
||||||
char *t, *r2;
|
char *t, *r2;
|
||||||
int amp_len = 0;
|
int amp_len = 0;
|
||||||
|
char *strz = str + strlen(str);
|
||||||
|
|
||||||
while (*str) {
|
while (str < strz) {
|
||||||
prev_status = status;
|
prev_status = status;
|
||||||
if (next_status(*str, &status)) {
|
if (next_status(*str, &status)) {
|
||||||
#ifdef USE_M17N
|
#ifdef USE_M17N
|
||||||
|
|||||||
Reference in New Issue
Block a user