emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 ac31663: Fix buffer overflow in fontname conversi


From: Alan Third
Subject: [Emacs-diffs] emacs-26 ac31663: Fix buffer overflow in fontname conversion (Bug#29523)
Date: Sat, 2 Dec 2017 08:49:33 -0500 (EST)

branch: emacs-26
commit ac316634e4452bcf97ff8ebc5fbabf27337a16dd
Author: Yuuki Harano <address@hidden>
Commit: Alan Third <address@hidden>

    Fix buffer overflow in fontname conversion (Bug#29523)
    
    * src/nsterm.m (ns_xlfd_to_fontname): Fix sscanf format.
    
    Copyright-paperwork-exempt: yes
---
 src/nsterm.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index 59a42ee..50e06c9 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]