cpukit: Prevent error with disabled stack checker

When the stack checker is not enabled, the stack checker reporting
function can still be called. This prevents that call from performing a
null memory access in trying to find the high water mark if the stack
checker was never initialized.

This also introduces a test to ensure this call does not cause a crash.

Closes #4588
This commit is contained in:
Kinsey Moore
2022-01-26 16:00:04 -06:00
committed by Joel Sherrill
parent 2145e0c7bf
commit b539af865e
6 changed files with 116 additions and 0 deletions

View File

@@ -247,6 +247,8 @@ links:
uid: stackchk
- role: build-dependency
uid: stackchk01
- role: build-dependency
uid: stackchk02
- role: build-dependency
uid: stat
- role: build-dependency

View File

@@ -0,0 +1,19 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
build-type: test-program
cflags: []
copyrights:
- Copyright (C) 2022 On-Line Applications Research (OAR)
cppflags: []
cxxflags: []
enabled-by: true
features: c cprogram
includes: []
ldflags: []
links: []
source:
- testsuites/libtests/stackchk02/init.c
stlib: []
target: testsuites/libtests/stackchk02.exe
type: build
use-after: []
use-before: []