bugm17n - Bugs: bug #50091, potential buffer-overrun in...

 
 

bug #50091: potential buffer-overrun in src/font.c: line 1368

Submitted by:  Kazuhiko Maekawa <kmaekawa>
Submitted on:  Thu 19 Jan 2017 10:48:29 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 08 Dec 2017 03:21:23 PM UTC, comment #1:

Thank you for finding this bug. I've just committed this fix.

diff --git a/src/font.c b/src/font.c
index 1136926..c0f748d 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1362,9 +1362,11 @@ mfont__set_spec_from_plist (MFont spec, MPlist plist)
for (i = 0; ! MPLIST_TAIL_P (plist); i++, plist = MPLIST_NEXT (plist))
{
if (! MPLIST_SYMBOL_P (plist))
- MERROR (MERROR_FONT, Mnil);
+ MERROR (MERROR_FONT, Mnil);
spec_list[i] = MPLIST_SYMBOL (plist);
}
+ if (i == 0)
+ MERROR (MERROR_FONT, Mnil);
registry = spec_list[i - 1];
if (i > 1 && registry != Mnil)
{

Kenichi Handa <handa>
Project Administrator
Thu 19 Jan 2017 10:48:29 AM UTC, original submission:

The following code in font.c could make buffer-overrun when the
plist size is zero.

mfont__set_spec_from_plist() in font.c: line 1368
-------------------------------------------------
for (i = 0; ! MPLIST_TAIL_P (plist); i++, plist = MPLIST_NEXT (plist))
{
if (! MPLIST_SYMBOL_P (plist))
MERROR (MERROR_FONT, Mnil);
spec_list[i] = MPLIST_SYMBOL (plist);
}
registry = spec_list[i - 1];
-------------------------------------------------

It looks that plist has data about "encoding" or "resize"
information defined in FONTENC.tbl or FONTSIZE.tbl which
are pointed in mdb.dir. When FONTENC.tbl/FONTSIZE.tbl have
no entry, the above code could make buffer-overrun.

Kazuhiko Maekawa <kmaekawa>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by handa (Posted a comment)
  • -unavailable- added by kmaekawa (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 08 Dec 2017 03:22:22 PM UTChandaStatusNone=>Fixed
    Fri 08 Dec 2017 03:21:49 PM UTChandaOpen/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1