Date: Thu, 30 Jan 2020 18:28:03 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357302 - head/sys/kern Message-ID: <202001301828.00UIS3UF050449@repo.freebsd.org>
index | next in thread | raw e-mail
Author: jhb Date: Thu Jan 30 18:28:02 2020 New Revision: 357302 URL: https://svnweb.freebsd.org/changeset/base/357302 Log: Fix use of an uninitialized variable. ctx (and thus ctx.flags) is stack garbage at the start of this function, so initialize ctx.flags to an explicit value instead of using binary operations on the garbage. Reported by: gcc9 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D23368 Modified: head/sys/kern/subr_stats.c Modified: head/sys/kern/subr_stats.c ============================================================================== --- head/sys/kern/subr_stats.c Thu Jan 30 18:12:41 2020 (r357301) +++ head/sys/kern/subr_stats.c Thu Jan 30 18:28:02 2020 (r357302) @@ -1583,9 +1583,7 @@ stats_v1_blob_iter(struct statsblobv1 *sb, stats_v1_bl int i, j, firstvoi; ctx.usrctx = usrctx; - ctx.flags |= SB_IT_FIRST_CB; - ctx.flags &= ~(SB_IT_FIRST_VOI | SB_IT_LAST_VOI | SB_IT_FIRST_VOISTAT | - SB_IT_LAST_VOISTAT); + ctx.flags = SB_IT_FIRST_CB; firstvoi = 1; for (i = 0; i < NVOIS(sb); i++) {help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001301828.00UIS3UF050449>
