aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/inc/str.h
diff options
context:
space:
mode:
authorMarvin Borner2021-04-03 18:32:07 +0200
committerMarvin Borner2021-04-03 18:32:07 +0200
commitbd1ad65704d44e3e06a587a890e8087bfd9abe3b (patch)
tree1c78794e0d1ca9f6e37119ef917b50de9f903446 /libs/libc/inc/str.h
parent4f5062cea9dc5448c1d8fc5ee78dcf211635ea97 (diff)
Added strnlen for buffer overflow prevention
Diffstat (limited to 'libs/libc/inc/str.h')
-rw-r--r--libs/libc/inc/str.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/libc/inc/str.h b/libs/libc/inc/str.h
index b00750b..542e586 100644
--- a/libs/libc/inc/str.h
+++ b/libs/libc/inc/str.h
@@ -6,6 +6,7 @@
#include <def.h>
u32 strlen(const char *s) NONNULL;
+u32 strnlen(const char *s, u32 max) NONNULL;
u32 strlcpy(char *dst, const char *src, u32 size) NONNULL;
char *strchr(char *s, char c) NONNULL;
char *strrchr(char *s, char c) NONNULL;
@@ -18,6 +19,7 @@ char *strdup(const char *s) NONNULL;
#ifdef KERNEL
u32 strlen_user(const char *s) NONNULL;
+u32 strnlen_user(const char *s, u32 max) NONNULL;
u32 strlcpy_user(char *dst, const char *src, u32 size) NONNULL;
char *strchr_user(char *s, char c) NONNULL;
char *strrchr_user(char *s, char c) NONNULL;