#700933 Unchecked conversion of input to enum

Package:
fontforge
Source:
fontforge
Description:
font editor
Submitter:
Michael Tautschnig
Date:
2026-08-09 22:59:02 UTC
Severity:
normal
#700933#5
Date:
2013-02-19 14:02:40 UTC
From:
To:
While building the package using our research compiler infrastructure, which
also performs more strict type checking, we noticed the following problem that
possibly triggers undefined behaviour:

In fontforge/scripting.c, the function bExpandStroke stores user input values
(of type double) in a field of type enum linecap (first appears in line 4653,
but also occurs multiple other times).

As there is no sanitization of input in place, the assignment may result in
arbitrary values being set.

Best,
Michael

#700933#10
Date:
2026-08-09 22:56:35 UTC
From:
To:
This is where the issue is addressed.
#700933#17
Date:
2026-08-09 22:57:22 UTC
From:
To: