Some compilers implicitly cast the result of uint_fast16_t *
uint_fast16_t to something signed and then complain about the
comparison to (unsigned) size_t.
Casting phnum to size_t is a good idea anyway as 16bit multiplication
can easily overflow and we are not checking for this.
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
+2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
+
+ * elf-from-memory.c: Explicitly cast phnum to size_t.
+
2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
* dwfl_module_getdwarf.c: Check shnum for 0 before subtracting from
{
/* Read in the program headers. */
- if (initial_bufsize < phnum * phentsize)
+ if (initial_bufsize < (size_t)phnum * phentsize)
{
unsigned char *newbuf = realloc (buffer, phnum * phentsize);
if (newbuf == NULL)