elflint.c: In function 'check_sections':
elflint.c:4105:48: error: null pointer dereference [-Werror=null-dereference]
4105 | idx < databits->d_size && ! bad;
| ~~~~~~~~^~~~~~~~
Fix this by testing for ! bad first.
Reported-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2021-10-06 Mark Wielaard <mark@klomp.org>
+
+ * elflint.c (check_sections): Don't dereference databits if bad.
+
2021-09-09 Dmitry V. Levin <ldv@altlinux.org>
* findtextrel.c: Include "libeu.h".
bad = (databits == NULL
|| databits->d_size != shdr->sh_size);
for (size_t idx = 0;
- idx < databits->d_size && ! bad;
+ ! bad && idx < databits->d_size;
idx++)
bad = ((char *) databits->d_buf)[idx] != 0;