Replace malloc() + memset() with calloc() Instead of manually clearing the memory with memset() use calloc(). Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
ucimap: Check return of malloc() Check the return value of malloc() before accessing it. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
ucimap: fix possible use of memory after it is freed scan-build from clang version 9 has reported following issue: ucimap.c:710:8: warning: Use of memory after it is freed err = ucimap_parse_options(map, sm, sd, s); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Petr Štetiar <ynezz@true.cz>
iron out all extra compiler warnings gcc 9.1 on x86/64 has reported following issues: list.c:140:11: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] file.c:572:51: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] file.c:850:15: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] file.c:865:15: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] delta.c:199:6: error: this statement may fall through [-Werror=implicit-fallthrough=] parse.c:80:12: error: this statement may fall through [-Werror=implicit-fallthrough=] parse.c:81:12: error: this statement may fall through [-Werror=implicit-fallthrough=] file.c:572:51: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] file.c:850:15: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] file.c:865:15: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] delta.c:199:6: error: this statement may fall through [-Werror=implicit-fallthrough=] parse.c:80:12: error: this statement may fall through [-Werror=implicit-fallthrough=] parse.c:81:12: error: this statement may fall through [-Werror=implicit-fallthrough=] ucimap.c:146:16: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ucimap.c:151:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ucimap.c:243:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ucimap.c:247:9: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ucimap.c:254:39: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ucimap.c:258:9: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ucimap.c:285:34: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ucimap.c:363:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ucimap.c:563:12: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ucimap.c:753:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] ucimap.c:879:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] Signed-off-by: Petr Štetiar <ynezz@true.cz>
style: fix whitespace errors Signed-off-by: Luka Perkov <luka@openwrt.org>
style: free(NULL) is perfectly valid so we can drop some checks Signed-off-by: Luka Perkov <luka@openwrt.org>
ucimap: initialize an uninitialized pointer (patch by Stanislav Fomichev)
ucimap: fix a memory leak (patch by Stanislav Fomichev)
add a few missing null pointer checks, and fix check vs dereference order in some cases (patch by Stanislav Fomichev)
check result of memory allocations (patch by Stanislav Fomichev)
ucimap: fix use-after-free on cleanup (patch by Stanislav Fomichev)
fix lgpl license headers
remove unused but set variable to fix a compiler warning
ucimap: ucimap_parse: consider smap_offset when allocating the section data Currently when there is no custom section data allocator the ucimap_section_data struct has to be at the beginning at the containing structure. This patch gets rid of that restriction by taking smap_offset into account. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
simplify code (thx, henning)
ucimap: simplify the parse/format callbacks. the data argument now always points to the field in the data structure
ucimap: fix list size initialization, validate list size on fixups as well
ucimap: fix list initialization
replace the use of list.h in the ucimap core, relicense ucimap to LGPL v2.1, update copyright headers
remove ucimap type->name conversion unless DEBUG is enabled