Prevent overflow beyond the end of string in visible_length()

Bug-Debian: https://github.com/tats/w3m/issues/73
This commit is contained in:
Tatsuya Kinoshita
2016-12-08 23:43:46 +09:00
parent a56a8ef132
commit a932f78a6d
+2 -1
View File
@@ -428,8 +428,9 @@ visible_length(char *str)
Str tagbuf = Strnew();
char *t, *r2;
int amp_len = 0;
char *strz = str + strlen(str);
while (*str) {
while (str < strz) {
prev_status = status;
if (next_status(*str, &status)) {
#ifdef USE_M17N