diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-08-17 13:56:03 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-08-17 13:56:03 -0700 |
commit | c1c5c9aa4cacb9138d6a2e5d37619f7960b54536 (patch) | |
tree | f7338555cf21d89b15c3e09e736c03e57990006e | |
parent | 78085e6b683b4e5a13b38508597a0c93ac2ed9ea (diff) |
ComputeScaledProperties: check for valid pointers before making atoms
Resolves coverity warning def23 from the list in
https://gitlab.freedesktop.org/xorg/lib/libxfont/issues/6
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/bitmap/bitscale.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bitmap/bitscale.c b/src/bitmap/bitscale.c index 1c68c5b..e29ba96 100644 --- a/src/bitmap/bitscale.c +++ b/src/bitmap/bitscale.c @@ -616,8 +616,10 @@ ComputeScaledProperties(FontInfoPtr sourceFontInfo, /* the font to be scaled */ *isStringProp = 0; switch (fpt->type) { case atom: - fp->value = MakeAtom(ptr1, ptr2 - ptr1, TRUE); - *isStringProp = 1; + if ((ptr1 != NULL) && (ptr2 != NULL)) { + fp->value = MakeAtom(ptr1, ptr2 - ptr1, TRUE); + *isStringProp = 1; + } break; case truncate_atom: for (ptr3 = ptr1; *ptr3; ptr3++) |