summaryrefslogtreecommitdiff
path: root/src/cff/cffobjs.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2020-06-20 05:31:34 +0200
committerWerner Lemberg <wl@gnu.org>2020-06-20 05:31:34 +0200
commita4434747558d872c55e55ce428019a8e15d222dc (patch)
tree95707683e5127d97991756a22efcfa7ae9b13368 /src/cff/cffobjs.c
parentde088b1dfd0dd549005feb503efe1b41ca668b36 (diff)
downloadfreetype2-a4434747558d872c55e55ce428019a8e15d222dc.tar.gz
[cff] Fix handling of `style_name == NULL' (#58630).
* src/cff/cffobjs.c (cff_face_init): If a call to `cff_strcpy' fails by returning NULL in `cff_face_init', `remove_style' is still called. This means that the NULL pointer is dereferenced, causing a crash.
Diffstat (limited to 'src/cff/cffobjs.c')
-rw-r--r--src/cff/cffobjs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 51430b2e3..d555d5235 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -950,7 +950,8 @@
style_name = cff_strcpy( memory, fullp );
/* remove the style part from the family name (if present) */
- remove_style( cffface->family_name, style_name );
+ if ( style_name )
+ remove_style( cffface->family_name, style_name );
}
break;
}