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/libgui/png.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 'libs/libgui/png.c')
-rw-r--r-- | libs/libgui/png.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/libgui/png.c b/libs/libgui/png.c index 6f8f4b5..2ff3340 100644 --- a/libs/libgui/png.c +++ b/libs/libgui/png.c @@ -90,7 +90,8 @@ static void *png_realloc(void *ptr, u32 new_size) static void png_free(void *ptr) { - free(ptr); + if (ptr) + free(ptr); } #else /*PNG_COMPILE_ALLOCATORS*/ /* TODO: support giving additional void* payload to the custom allocators */ |