sawfish/src/fonts.c: xlfd_get_element() writes 1 byte beyond allocated memory



Hello!

Please commit the following patch against the current fonts.c:

--- sawfish/src/fonts.c.orig    Tue Feb  7 00:15:27 2006
+++ sawfish/src/fonts.c Tue Feb  7 00:15:37 2006
@@ -131,7 +131,7 @@
            if (end == 0)
                end = p + strlen (p);
            len = end - (p + 1);
-           buf = malloc (len);
+           buf = malloc (len + 1);
            memcpy (buf, p + 1, len);
            buf[len] = 0;
            return buf;

FreeBSD project  is "responsible" for unhiding this bug: they have
malloc debugging temporary enabled by default in -current.

-- 
WBR, Victor V. Snezhko
EMail: snezhko indorsoft ru





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