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 /kernel/features/mm.c | |
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 'kernel/features/mm.c')
-rw-r--r-- | kernel/features/mm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/features/mm.c b/kernel/features/mm.c index d01c978..5356ab4 100644 --- a/kernel/features/mm.c +++ b/kernel/features/mm.c @@ -417,7 +417,7 @@ struct memory_proc_link { static struct list *memory_objects = NULL; res memory_sys_alloc(struct page_dir *dir, u32 size, u32 *addr, u32 *id, u8 shared) { - if (!addr || !memory_valid(addr) || !id || !memory_valid(id)) + if (!memory_valid(addr) || !memory_valid(id)) return -EFAULT; size = PAGE_ALIGN_UP(size); @@ -474,7 +474,7 @@ res memory_sys_free(struct page_dir *dir, u32 addr) res memory_sys_shaccess(struct page_dir *dir, u32 id, u32 *addr, u32 *size) { - if (!addr || !memory_valid(addr) || !size || !memory_valid(size)) + if (!memory_valid(addr) || !memory_valid(size)) return -EFAULT; *addr = 0; |