Skip to content

Commit f7da133

Browse files
committed
Add NullChecks to strspn.cpp
1 parent beb57d9 commit f7da133

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libc/src/string/strspn.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111
#include "src/__support/CPP/bitset.h"
1212
#include "src/__support/common.h"
1313
#include "src/__support/macros/config.h"
14+
#include "src/__support/macros/null_check.h"
1415
#include <stddef.h>
1516

1617
namespace LIBC_NAMESPACE_DECL {
1718

1819
LLVM_LIBC_FUNCTION(size_t, strspn, (const char *src, const char *segment)) {
20+
LIBC_CRASH_ON_NULLPTR(src);
21+
LIBC_CRASH_ON_NULLPTR(segment);
1922
const char *initial = src;
2023
cpp::bitset<256> bitset;
2124

0 commit comments

Comments
 (0)