From afa00abb2b68205bee539d7947130d6b1b1ec6e9 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 1 Apr 2021 19:39:14 +0200 Subject: Hardened entire system By using the nonnull attribute and replace buffer-overflow-prone functions like strcpy, strcat and sprintf by strlcpy, strlcat and snprintf. --- libs/libc/inc/list.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libs/libc/inc/list.h') diff --git a/libs/libc/inc/list.h b/libs/libc/inc/list.h index 0b82b48..fea98dc 100644 --- a/libs/libc/inc/list.h +++ b/libs/libc/inc/list.h @@ -17,13 +17,13 @@ struct node { }; struct list *list_new(void); -void list_destroy(struct list *list); +void list_destroy(struct list *list) NONNULL; /* struct node *list_new_node(); */ // TODO: Make node-specific things static/private? /* void list_add_node(struct list *list, struct node *node); */ -struct node *list_add(struct list *list, void *data); -struct list *list_remove(struct list *list, struct node *node); -struct node *list_last(struct list *list); -struct list *list_swap(struct list *list, struct node *a, struct node *b); -struct node *list_first_data(struct list *list, void *data); +struct node *list_add(struct list *list, void *data) NONNULL; +struct list *list_remove(struct list *list, struct node *node) NONNULL; +struct node *list_last(struct list *list) NONNULL; +struct list *list_swap(struct list *list, struct node *a, struct node *b) NONNULL; +struct node *list_first_data(struct list *list, void *data) NONNULL; #endif -- cgit v1.2.3