Skip to content

Misc CVE fixes#4091

Merged
ctrlcctrlv merged 1 commit into
fontforge:masterfrom
skef:cve
Jan 6, 2020
Merged

Misc CVE fixes#4091
ctrlcctrlv merged 1 commit into
fontforge:masterfrom
skef:cve

Conversation

@skef

@skef skef commented Jan 6, 2020

Copy link
Copy Markdown
Contributor

Fix for #4084 Use-after-free (heap) in the SFD_GetFontMetaData() function
Fix for #4086 NULL pointer dereference in the SFDGetSpiros() function
Fix for #4088 NULL pointer dereference in the SFD_AssignLookups() function
Add empty sf->fontname string if it isn't set, fixing #4089 #4090 and many
other potential issues (many downstream calls to strlen() on the value).

Closes #4084
Closes #4086
Closes #4088
Closes #4089
Closes #4090

Meta-note: That I am continually annoyed at the number of open FontForge issues does not imply this is not a waste of time.

…ta() function

Fix for fontforge#4086 NULL pointer dereference in the SFDGetSpiros() function
Fix for fontforge#4088 NULL pointer dereference in the SFD_AssignLookups() function
Add empty sf->fontname string if it isn't set, fixing fontforge#4089 fontforge#4090 and many
  other potential issues (many downstream calls to strlen() on the value).
Comment thread fontforge/sfd.c
Comment on lines -4035 to +4036
cur->spiros = realloc(cur->spiros,(cur->spiro_max+=10)*sizeof(spiro_cp));
cur->spiros = realloc(cur->spiros,
(cur->spiro_max+=10)*sizeof(spiro_cp));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>>> L1="                cur->spiros = realloc(cur->spiros,(cur->spiro_max+=10)*sizeof(spiro_cp));"
>>> L2="""
		cur->spiros = realloc(cur->spiros,
		                      (cur->spiro_max+=10)*sizeof(spiro_cp));"""
>>> import re
>>> re.sub(r'\s+', '', L2) == re.sub(r'\s+', '', L1)
True

What is the purpose of the added line break?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just increasing conformance with the mostly-followed 80 char/line rule while I was in the neighborhood.

@ctrlcctrlv ctrlcctrlv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ctrlcctrlv ctrlcctrlv merged commit 048a91e into fontforge:master Jan 6, 2020
@frank-trampe

Copy link
Copy Markdown
Contributor

You guys played really hard-to-get on this one!

@skef

skef commented Jan 6, 2020

Copy link
Copy Markdown
Contributor Author

@frank-trampe These sorta feel less like maintenance than gamification.

@frank-trampe

Copy link
Copy Markdown
Contributor

It's all the rage these days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants