summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuuki Harano <masm-emacs@masm11.ddo.jp>2017-12-01 19:31:16 +0000
committerAlan Third <alan@idiocy.org>2017-12-02 13:45:51 +0000
commitac316634e4452bcf97ff8ebc5fbabf27337a16dd (patch)
tree6ce8176e84f75674ddb1a4224747dd4802453f99
parentbf9b972843113dd1fb416f5bd7cb127eaf4927d0 (diff)
downloademacs-ac316634e4452bcf97ff8ebc5fbabf27337a16dd.tar.gz
Fix buffer overflow in fontname conversion (Bug#29523)
* src/nsterm.m (ns_xlfd_to_fontname): Fix sscanf format. Copyright-paperwork-exempt: yes
-rw-r--r--src/nsterm.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nsterm.m b/src/nsterm.m
index 59a42eed887..50e06c94d45 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -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)