In case of ENCODING_8BIT the EOF code will be pass to putchar.

EOF check should be done before (uint8_t)c > 127 test.

Reported by:	cem
This commit is contained in:
Mariusz Zaborski 2019-03-21 06:31:14 +00:00
parent 3ace9199b4
commit 1194c3cb57

View file

@ -402,13 +402,13 @@ find_strings(const char *name, FILE *pfile, off_t offset, off_t size)
break;
c = getcharacter(pfile);
cur_off += encoding_size;
if (!PRINTABLE(c) || c == EOF)
break;
if (encoding == ENCODING_8BIT &&
(uint8_t)c > 127) {
putchar(c);
continue;
}
if (!PRINTABLE(c) || c == EOF)
break;
putchar(c);
}
putchar('\n');