1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-08 23:40:24 -08:00

Fix buffer overflow in fontname conversion (Bug#29523)

* src/nsterm.m (ns_xlfd_to_fontname): Fix sscanf format.

Copyright-paperwork-exempt: yes
This commit is contained in:
Yuuki Harano 2017-12-01 19:31:16 +00:00 committed by Alan Third
parent bf9b972843
commit ac316634e4

View file

@ -9152,9 +9152,9 @@ ns_xlfd_to_fontname (const char *xlfd)
const char *ret;
if (!strncmp (xlfd, "--", 2))
sscanf (xlfd, "--%*[^-]-%[^-]179-", name);
sscanf (xlfd, "--%*[^-]-%179[^-]-", name);
else
sscanf (xlfd, "-%*[^-]-%[^-]179-", name);
sscanf (xlfd, "-%*[^-]-%179[^-]-", name);
/* stopgap for malformed XLFD input */
if (strlen (name) == 0)