+2019-11-05 Tim Rühsen <tim.ruehsen@gmx.de>
+
+ * doc/chew.c (add_to_definition): Use correct type when
+ calculating size of array reallocation.
+ (nextword): Always initialise the word return parameter.
+ (compile): Check return value of nextword().
+
2019-10-30 Keith Seitz <keiths@redhat.com>
* elf-bfd.h (elf_backend_data) <elf_backend_core_find_build_id>:
}
}
if (!*string)
- return 0;
+ {
+ *word = NULL;
+ return NULL;
+ }
word_start = string;
if (*string == '"')
if (*string)
return string + 1;
else
- return 0;
+ return NULL;
}
dict_type *root;
}
if (warning)
fprintf (stderr, "Can't find %s\n", word);
- return 0;
+ return NULL;
}
static void
}
static void
-perform ()
+perform (void)
{
tos = stack;
entry->code_length += 2;
entry->code =
(stinst_type *) realloc ((char *) (entry->code),
- entry->code_length * sizeof (word_type));
+ entry->code_length * sizeof (stinst_type));
}
entry->code[entry->code_end] = word;
{
free (word);
string = nextword (string, &word);
+ if (!string)
+ continue;
add_var (word);
string = nextword (string, &word);
}
/* Compile a word and add to dictionary. */
free (word);
string = nextword (string, &word);
+ if (!string)
+ continue;
ptr = newentry (word);
string = nextword (string, &word);
+ if (!string)
+ {
+ free (ptr->code);
+ free (ptr);
+ continue;
+ }
while (word[0] != ';')
{
}
add_to_definition (ptr, 0);
free (word);
- word = NULL;
string = nextword (string, &word);
}
else