aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuuki Harano2017-12-01 19:31:16 +0000
committerAlan Third2017-12-02 13:45:51 +0000
commitac316634e4452bcf97ff8ebc5fbabf27337a16dd (patch)
tree6ce8176e84f75674ddb1a4224747dd4802453f99
parentbf9b972843113dd1fb416f5bd7cb127eaf4927d0 (diff)
downloademacs-ac316634e4452bcf97ff8ebc5fbabf27337a16dd.tar.gz
emacs-ac316634e4452bcf97ff8ebc5fbabf27337a16dd.zip
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)
9152 const char *ret; 9152 const char *ret;
9153 9153
9154 if (!strncmp (xlfd, "--", 2)) 9154 if (!strncmp (xlfd, "--", 2))
9155 sscanf (xlfd, "--%*[^-]-%[^-]179-", name); 9155 sscanf (xlfd, "--%*[^-]-%179[^-]-", name);
9156 else 9156 else
9157 sscanf (xlfd, "-%*[^-]-%[^-]179-", name); 9157 sscanf (xlfd, "-%*[^-]-%179[^-]-", name);
9158 9158
9159 /* stopgap for malformed XLFD input */ 9159 /* stopgap for malformed XLFD input */
9160 if (strlen (name) == 0) 9160 if (strlen (name) == 0)