Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wsfont wsfont_rotate(): Add missing NULL check for w...



details:   https://anonhg.NetBSD.org/src/rev/e23be31d0886
branches:  trunk
changeset: 1026348:e23be31d0886
user:      rin <rin%NetBSD.org@localhost>
date:      Fri Nov 19 23:50:39 2021 +0000

description:
wsfont_rotate(): Add missing NULL check for wsfont_find0().

diffstat:

 sys/dev/wsfont/wsfont.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 5ec90965a167 -r e23be31d0886 sys/dev/wsfont/wsfont.c
--- a/sys/dev/wsfont/wsfont.c   Fri Nov 19 23:46:54 2021 +0000
+++ b/sys/dev/wsfont/wsfont.c   Fri Nov 19 23:50:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wsfont.c,v 1.71 2020/11/23 12:15:39 rin Exp $  */
+/*     $NetBSD: wsfont.c,v 1.72 2021/11/19 23:50:39 rin Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsfont.c,v 1.71 2020/11/23 12:15:39 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsfont.c,v 1.72 2021/11/19 23:50:39 rin Exp $");
 
 #include "opt_wsfont.h"
 
@@ -563,6 +563,9 @@
        origfont = wsfont_find0(cookie, 0xffffffff);
        splx(s);
 
+       if (origfont == NULL)
+               return (-1);
+
        switch (rotate) {
        case WSFONT_ROTATE_CW:
                font = wsfont_rotate_cw_internal(origfont->font);



Home | Main Index | Thread Index | Old Index