From ff844df719d7226a46b8cb0d99aef9480cced247 Mon Sep 17 00:00:00 2001 From: Aly ElAshram <71949028+AlyElashram@users.noreply.github.com> Date: Wed, 4 Jun 2025 20:08:27 +0300 Subject: [libc] Expand usage of libc null checks. (#116262) Fixes #111546 --------- Co-authored-by: alyyelashram <150528548+alyyelashram@users.noreply.github.com> --- libc/src/string/strspn.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libc/src/string/strspn.cpp') diff --git a/libc/src/string/strspn.cpp b/libc/src/string/strspn.cpp index 66bb39903ab3..b205bedf80ca 100644 --- a/libc/src/string/strspn.cpp +++ b/libc/src/string/strspn.cpp @@ -11,11 +11,14 @@ #include "src/__support/CPP/bitset.h" #include "src/__support/common.h" #include "src/__support/macros/config.h" +#include "src/__support/macros/null_check.h" #include namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(size_t, strspn, (const char *src, const char *segment)) { + LIBC_CRASH_ON_NULLPTR(src); + LIBC_CRASH_ON_NULLPTR(segment); const char *initial = src; cpp::bitset<256> bitset; -- cgit v1.2.3