diff options
author | Marvin Borner | 2021-04-01 19:39:14 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-01 19:39:14 +0200 |
commit | afa00abb2b68205bee539d7947130d6b1b1ec6e9 (patch) | |
tree | 3a821a75af6c4d4ff1bd4128c4859d77abf87e66 /libs/libtxt | |
parent | 4c168fb34c15a1b8981abef7ccef1542a6fb05ca (diff) |
Hardened entire system
By using the nonnull attribute and replace buffer-overflow-prone
functions like strcpy, strcat and sprintf by strlcpy, strlcat and
snprintf.
Diffstat (limited to 'libs/libtxt')
-rw-r--r-- | libs/libtxt/html.h | 2 | ||||
-rw-r--r-- | libs/libtxt/keymap.h | 4 | ||||
-rw-r--r-- | libs/libtxt/xml.h | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/libs/libtxt/html.h b/libs/libtxt/html.h index c1b29f2..ea2cfb8 100644 --- a/libs/libtxt/html.h +++ b/libs/libtxt/html.h @@ -21,6 +21,6 @@ struct html_element { struct element *obj; }; -int html_render(struct element *container, char *data, u32 length); +int html_render(struct element *container, char *data, u32 length) NONNULL; #endif diff --git a/libs/libtxt/keymap.h b/libs/libtxt/keymap.h index 9f1966e..4f5512f 100644 --- a/libs/libtxt/keymap.h +++ b/libs/libtxt/keymap.h @@ -3,6 +3,8 @@ #ifndef KEYMAP_H #define KEYMAP_H +#include <def.h> + #define KEYMAP_LENGTH 90 struct keymap { @@ -11,6 +13,6 @@ struct keymap { char alt_map[KEYMAP_LENGTH]; }; -struct keymap *keymap_parse(const char *path); +struct keymap *keymap_parse(const char *path) NONNULL; #endif diff --git a/libs/libtxt/xml.h b/libs/libtxt/xml.h index 43a8005..3f5c74d 100644 --- a/libs/libtxt/xml.h +++ b/libs/libtxt/xml.h @@ -44,8 +44,8 @@ struct xml { }; enum xml_error xml_parse(struct xml *parser, const char *buffer, u32 buffer_length, - struct xml_token *tokens, u32 num_tokens); + struct xml_token *tokens, u32 num_tokens) NONNULL; -void xml_init(struct xml *parser); +void xml_init(struct xml *parser) NONNULL; #endif |