mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
vtfontcvt: improve hex font format validation
Previously an EOF would result in sscanf returning -1 leading to a
crash.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 119db52f42)
This commit is contained in:
1 parent
e7198df484
commit
5db2f88fa5
1 file changed
+1
-1
@@ -450,7 +450,7 @@ parse_hex(FILE *fp, unsigned int map_idx)
|
||||
if (bytes != NULL)
|
||||
errx(1, "malformed input: Width tag after font data");
|
||||
set_width(atoi(ln + 9));
|
||||
} else if (sscanf(ln, "%6x:", &curchar)) {
|
||||
} else if (sscanf(ln, "%6x:", &curchar) == 1) {
|
||||
if (bytes == NULL) {
|
||||
bytes = xmalloc(wbytes * height);
|
||||
bytes_r = xmalloc(wbytes * height);
|
||||
|
||||
Reference in new issue
Block a user